===== Data Processing School :: Exercise 62 ===== ^ Source directory | /data/lofarschool/data/exercise-62 | ^ Contact person | James Miller-Jones (/John Swinbank) | ==== Context ==== Having carried out Exercises [[Exercise 60|60]] and [[Exercise 61|61]], the user has a basic grasp of CASA. We now use CASA to image a previously-calibrated MS, implementing the //w//-projection algorithm. === Prerequisite === * Working CASA installation * Knowledge of Python ==== Description ==== To save time, we will first split off 24h of data from the MS, making the data to be imaged a more manageable size. Since LOFAR is not in the CASA repository as yet, and since we wish to use //w//-projection, we will not use any of the pre-packaged tasks, but instead, will use tools from the CASA toolkit. Using the //im// tool, we will image the SPLIT dataset. This Exercise will also demonstrate how to run a CASA python script, rather than typing in commands at the command-line prompt. ==== Files & Directories ==== * ''instructions.txt'' contains a listing of commands to be typed or cut/pasted into the CASA prompt, and explanation of what to do and what to expect at each step * ''make_image.py'' is the CASA script that will run the imaging tools. * The ''outputs'' directory contains a sample image * ''README'' contains links to further documentation about CASA ==== Step-by-step instructions ==== First of all, start up CASA $ /app/Casa/x86_64/bin/casapy As before, set the variable msfile to the MS name: CASA <3>: msfile='../Exercise-60/L4086_sSB10.MS' Now we are going to split off 24h worth of data from the original MS. CASA <5>: default(split) CASA <6>: vis=msfile CASA <7>: outputvis = 'L4086_split.MS' CASA <8>: timerange = '2007/10/21/12:00:00~2007/10/22/12:00:00' CASA <9>: datacolumn = 'corrected' CASA <10>: go ---------> go() Executing: split() This will create a new MS in the working directory, called //L4086_split.MS//. We are going to image this using the make_image.py script. CASA <11>: execfile('make_image.py') The //execfile// command runs a script in the current directory. This can be a complicated python script, or just a set of CASA commands. Feel free to examine the script, and create one of your own, with different parameters. Again, since LOFAR is not in the CASA data repository, various warning messages appear when performing the imaging. Once the image has been created, we will want to see what it looks like. For this, we will use the CASA viewer: CASA <12>: default(viewer) CASA <13>: infile='L4086.img' CASA <14>: displaytype='raster' CASA <15>: go() Executing: viewer() //outputs/image.pdf// shows an example of the resulting image. Use the left mouse button to drag out a rectangular area, and then double click inside that area to zoom in. Use the middle mouse button to fiddle with the colour scale. Zoom back out with the magnifying glass at the top of the screen. ==== Example outputs ==== The resulting image looks a bit like this: {{exercise-62-image.png}}