Data Reduction for Polarization Calibration


These instructions presume a working knowledge of Aips. Please refer to the Aips Cookbook for detailed instructions on running the tasks.

Before starting Aips, create a directory for the date of the polcal observation; e.g., 20040524. Copy the scripts to and run Aips from this directory.


Edit Aips Scripts

  1. Edit the calibrators in the scripts:


    polcal = the calibrator with the most scans around 30 degrees
    phacal = all calibrators except abscal and weacal
    weacal = any calibrator with flux of less than 1 jy
    strongcal = any calibrator with flux of more than 10 jy
    abscal = 3C48 (0137+331) or 3C286 (1331+305)
    absref = reference antenna
    numcal = number of phacal calibrators

  2. For K & Q Bands, add the opacity value


    From the Tip Curve Data Tool, select the year of data, band and the observation date on which the polcal data was taken.

    Find the "fitted zenith opacity" on the data page. This is a percentage and should be entered in the script as the correct value; e.g., 7.1% = .071

Return to top


Load Data With FILLM

  1. To load from current visibility data:

    version 'online' Be sure the correct device is mounted
    nfiles 0 0=today; -x for number of previous days, up to 13
    vlaobs 'polca'
    timer Set time range for which observation was run
    bparm(1)=-1 No opacity
    bparm(2)=1 Use Aips gains
    cparm 8=10/60 Use 10 second intervals

  2. To load from visibility data older than 14 days:


    From the NRAO Data Archive System, download the data to a disk file. Use the above parameters in FILLM with the following exceptions:

    nfile 'filename' where filename is the name of the downloaded file. If the final quote is omitted in filename, the case is preserved. Aips adds a 1 to the end of the filename.
    timer 0
    vlaobs ''
    docat=1 If the archive file spans two files, user docat=1 to append the second file.
    ncount=x Where x = the number of files to read.

Return to top

List Calibrators with LISTR

  1. LISTR parameters

    optype 'scan' Lists each scan with time and source name
    docrt 1 Print results on screen
    version ''

  2. Look for a calibrator with a dec around 30 degrees with the most number of scans. This is your 'phacal' in the Aips scripts.
Return to top

Quack and Flag Data

  1. QUACK parameters

    opcode 'beg' Beginning
    aparm 0 10/60 Quack first 10 seconds
    sources '' All sources

  2. Flag data with uvflg or tvflg

    TVFLG Parameters
    tvcl; grcl Clear data and grid on TV
    default tvflg Restore defaults
    dparm(6) 3.3 Set flagging rate
    stokes 'rrll' All stokes
    flagver 1 Flag table version 1

    After TVFLG is running, enter stokes '1111' and switch all IF. Use tvfiddle to set up zoom and dynamic range.

Return to top

Run Procedures from Scripts

  1. From Aips:

    restore 0 Resets all parameters
    version 'pwd' Run from current directory
    run calb? Where ? is the band designator
    setit Sets up script defaults
    dowait 1 Stop at first error
    calgain(i) run for K & Q only, where i is the file number from Aips
    caldata(i)
    listcal(i) Check amplitudes (see below)
    calpol(i)
    outpol(i) Runs imagr; this takes several minutes

Return to top

Checking

  1. Examine output files
  2. *.PCAL files show the polarization leakage. This should be within a few degrees or less (.01 or .02) at C band. K should be less than 0.10. In Q, the error should be less than the leakage.

    Polarization leakages greater than maximum indicate antenna problems which should be reported to the front end group.

    *.POLC are the residuals. One antenna will be off in phase for a bad leakage calibrator. The gain should be ~3xxx and consistent. A high number equals low amplitude and may indicate that more flagging needs to be done with the data.

    *.TXT are summary files. Use the command:

    grep IF= *.TXT

    The RL phase angle divided by 2 is the polarization angle. The phase angles should be within a few degrees in each IF; these are in mjy.

    To determine phase:
    grep PHASE *.TXT

Return to top

Transferring to Web

The data are summarized into html format through a group of Perl scripts. The scripts should be located in your higher level directory and the data located in sub-directories with the format yyyymmdd; e.g., 20040101.

  1. To create html code for each sub-directory, from the high level directory, enter:
  2. calgen.pl yyyymmdd

    This will create the html files within the sub-directory yyyymmdd. A separate file will be created for each calibrator.

  3. To create a summary of all html files, from the high level directory, enter:
  4. calextract.pl

    This will create a summary html file which you can view with any web browser:

    master.html (all bands)
    X_band.html
    C_band.html
    K_band.html
    Q_band.html

    These files may then be transferred to the web page:

    /home/nraoweb/vla/content/astro/calib/polar/YYYY/yyyymmdd

    Transfer all *.html, *.CALIB, *.TXT and the Aips scripts which were run to produce the data. It is also a good idea to archive the data with fittp and transfer that archived data to the web directory. This insures the data could be recovered if needed.

Return to top

Common Mistakes

  1. Forgetting to change directories

    Aips has no way to change directories without first quitting Aips and restarting. Each set of scripts and data must be contained in a unique directory with the name format of yyyymmdd.

  2. Typographical errors in scripts

    Typos, especially in the source names, create havoc with Aips. If you get any unusual errors, first check the names of all sources.

  3. Duplicate imagr files

    Sometimes, imagr files are left on indisk 2. Do an mcat and delete all imagr files before running outpol.

  4. Running the wrong script for the data file

    This can make Aips looks like it's gone insane, plus make Eric really mad at you for doing such a foolish thing and then asking for help.

  5. Dowait not set

    The result is that Aips will not stop at the first error. By the time it gets confused enough to stop, you have no idea what really went wrong.

  6. Restore 0 not entered

    Old parameters may be left over from previous scripts or other functions in Aips.

  7. Forgetting where you are

    With interruptions, it's easy to forget where you are, either within a day's calibration, or within a band. It is a good idea to keep a log of what's been done.

  8. Numcal incorrect

    Forgetting to change numcal to match the number of calibrators really sends Aips off into never-never-land. Double-check this number before running the script.

  9. Rerunning scripts

    After a script has been modified, it must be rerun. First, restore 0, then run the script. It is easy to forget to rerun the script after it has been corrected.

  10. Bad data

    If one antenna has very high gains, this throws the rest of the antennas off, making the flux look higher than normal. This may not be evident in tvflg. Run listr with optype 'gain' to check for very high gains in one antenna.

Return to top
Maintained by pvanbusk@aoc.nrao.edu, last updated May 2004