This document is out of date, and is kept around for historical purposes only

Please refer to CalicoDocumentation for newer documents.

The Many Ways To Skin a (WSRT) Cat With Calico

This document is meant to be a step-by-step recipe for reducing a WSRT dataset with Calico. Readers are HIGHLY ENCOURAGED to extend this with their own experiences and comments. The target audience is the "button-pushing astronomer". Power users who mean to extend Calico scripts with new features, or write new Calico modules, will need their own documentation.

In this example, we will reduce a 1.4GHz observation of 3C147. You can download the measurement set, 3C147_spw0.MS, and a sky model, BAND0.MDL here:

A complete log of my data reduction experiences can be found in OlegSmirnov/CalibrationEfforts and OlegSmirnov/CalibrationEfforts/3C147_Band0.

1. Prerequisites

For WSRT data, three Calico scripts are currently provided:

All scripts currently reside under Timba/FW/Calico. Place your MSs there (or alternately, copy the scripts to another location.)

2. Quick Look: calico-view-ms.py

This script is meant for quick look at the data, and for flag management. When you load this script in the browser, you're presented with a standard MS selection menu. The top part of the menu is common to all Calico scripts, so it is documented on a separate page: ../MSSelectionMenu

The last option in the menu, when enabled, inverts the phases when reading the input data (on-the-fly, the MS is not actually changed.) This is not important for quick look, but may be important in calibration.

Once you have set up the MS selection, press "Compile" to build the tree. A menu called "TDL Jobs & Runtime Options" will pop up.

2.1. Looking at bookmarks

To see anything useful, you want to load a few Bookmarks from the top-level menu of the browser. Do this before clicking anything in the Runtime Options menu.

2.2. Running the viewer

Before you run the viewer, you must make sure the "Data selection & flag handling" submenu is set up properly. This is common to all Calico scripts, so it is documented on a separate page: ../DataSelectionMenu.

To look at your raw data, select the DATA column under "Data selection". Now, make sure that "Data description ID" is set to 1 (since we're dealing with spectral window 1 here.) Now select "view MS" and observe the plots.

3. Preliminary flagging

For starters, read ../FlagHandling. This provides an overview of how MeqTrees and Calico handle flags.

Following the explanation in OlegSmirnov/CalibrationEfforts/3C147_Band0, we want to start by flagging the even channels (0,2,4,...), plus channels 5,7,53,55. This can be done by running the calico-flagger.py script. In compile-time options, select

3.1. Using the autoflag tool

For preliminary flagging, you want to flag:

This is easiest to do with the aips++ autoflag tool as follows:

Note the flagreport.ps file that will show up in your current directory. This contains a flagging report that may be useful to study.

If using Hanning tapering (and thus calibrating on every second channel), you also want to flag every even or every odd channel. This is due to a bug in the aips++/casarest imager -- it is unable to use channel stepping propely, so it's easier to just flag the even/odd channels so that the imager ignores them.

NB: you must use calico-flagger.py for this. Insert instructions here.

3.2. Transferring flags into a flagset

Once all this is done, you probably want to transfer these flags into a flagset. Read ../FlagHandling for an overview. The basic steps are:

3.2.1. Review flags to make sure they're sensible

3.2.2. Write these flags into a flagset

3.2.3. Verify new flagset

Congratulations, you have your first flagset. You may verify this by re-compiling1 the calico-view-ms.py script, and then

The results should be the same as at step 1 -- but due to different option settings, we are now using the flagset BASIC, rather than the legacy FLAG column.

4. Calibration proper: initial setup

Now load the calico-wsrt.py script. This is main calibration script. You will want to setup compile-time options as follows:

You can now press "Compile" to build the tree.

5. Calibration proper: setting up input data

Under the runtime options menu that pops up, go to "Data selection & flag handling". The full menu is documented in ../DataSelectionMenu and ../FlagHandling. What you need to do here is:

6. Calibrating For G

Time for an actual calibration. Open up the "Calibrate G diagonal terms" menu. What we want to do is solve for the G term (receiver gain), constant in frequency, with one independent solution per each timeslot. This is accomplished by setting:

Now, load a few bookmarks. At the least, load "inspector:G" (this will show the G solutions as a function of time), and "Inspect corrected data or residuals" (which will display per-baseline frequency-averaged residuals as a function of time).

Click on "Calibrate G diagonal terms" and wait for the solution to end. If all went well, you should see:

7. Calibrating For B

The previous solution only took out the average (over frequency) receiver gain. Now we need to solve for antenna bandpasses. Bandpasses have almost the opposite behaviour to reciever gains: they have significant variation in frequency, but almost none in time. Bandpasses are designated by the B term in our measurement equation.

Note that the B term and the G term are implemented in exactly the same way, the only difference is their time and frequency behaviour. To get the desired behaviour for B, open up the "Calibrate B diagonal terms" menu, and set:

Now, load a few bookmarks. At the least, load "inspector:G" (this will show your previous G solutions as a function of time), and "Inspect corrected data or residuals" (which will display per-baseline frequency-averaged residuals as a function of time). Also, open up a page or two under "B diagonal terms".

Now click on "Calibrate B diagonal terms" and wait for the solution to end. If all went well, you should see:

8. FLagging On Residuals

9. Recalibrating For G

Now that the bandpasses have been fitted, you may want to go back and repeat the G solution, it will be considerably improved.

10. Making an image

It's time to make a residual image. Go into 'Imaging options', set:

Now click on "MAke a dirty image", and wait for the image to come up.

11. Viewing the image

If you're using the Karma viewer, you can go to Overlay: Load annotations to display the LSM annotation file produced at the previous step. This shows where the model soures are.

12. More flagging

It is obvious from the image that some more flagging is required. Also, from the residuals seen during the solution, it's clear that all baselines with RT7 are bad. We can flag all baselines with RT7 as follows:

You can then transfer these flags to a new flagset (call it "RT7". It's handy to have them in a sepaate flagset, so that later we can compare calibration with and without RT7 flagged.) Then, you can flag outliers in the residuals of the previous solution (i.e. the CORRECTED_DATA column):

Again check the flagreport.ps file for flag statistics. Transfer these flags to a new flagset, as described above, call it "RESIDUALS1".

13. Re-image

14. Re-solve

15. E solutions

  • 1 currently, scripts need to be recompiled every time a new flagset is created, otherwise the new name is not picked up by the menus

CalicoDocumentation/OutOfDate/WesterborkCookbook (last edited 2008-12-12 13:17:57 by OlegSmirnov)