Analysis of WSRT DZB data with classic AIPS

(By Robert Braun, updated by Gyula Józsa)

Although the AIPS package was designed rather specifically for VLA data, it can be used quite successfully for the reduction and analysis of some types of WSRT data. The most important limitation of AIPS for more general use, is the deeply embedded assumption that right and left circular polarization products are measured rather than, for example, perpendicular linear products, which are normally measured with the WSRT. The implication is that WSRT users who are interested in analyzing Stokes parameters other than Stokes I, will either need to be quite creative in their use of AIPS (as outlined below) or make use of another package for calibration and production of Stokes databases or images. Once such data are converted to a particular Stokes parameter, then AIPS could still be used for analysis if that were desirable.

Another drawback of AIPS is that its imager does not check whether the uvw coordinates of the visibilities lie in a common plane with its normal vector pointing towards the pole. As a result, the assigned coordinate system which gets written into the header after a simple Fourier transformation of the data is not NCP (which would be correct over the entire field, but only valid for an EW-array), but SIN (which is correct only close to the phase centre, but also valid for non-EW-arrays like the VLA). After using the task IMAGR this can be corrected by simply replacing the header variables CTYPE1 from RA---SIN to RA---NCP and CTYPE2 from DEC--SIN to DEC--NCP, making use of the task PUTHEAD.

The simplest way to deal with WSRT data within AIPS is to re-define the actual polarization products which were measured, calling them right and left circular, rather than perpendicular linear. What's measured is approximately (for the WSRT feeds, the x-direction is defined to increase from E to W, y from S to N), XX=I-Q, YY=I+Q, XY=-U+iV and YX=-U-iV, while for the VLA one has approximately, RR=I+V, LL=I-V, RL=Q+iU, LR=Q-iU. You can see from these two sets of equations that they are similar, except you have -Q in the place of V, -U in the place of Q and V in the place of U. The implication is that the true Stokes (I,Q,U,V) parameters will need to be specified within AIPS as (I,-V,-Q,U). Renaming works fine for intrinsically unpolarized sources, but does lead to complications for sources which have intrinsic polarization. One source in particular deserves special mention in this regard. 3C286 is used as a primary calibrator for WSRT observations, but is in fact about 10% linearly polarized with PA=33 deg. at frequencies above 1 GHz. Near 1400 MHz, 3C286 has approximately Stokes (I,Q,U,V)=(14.65,0.56,1.26,0.00) Jy. Since the value of Q is non-zero, the measured values of XX and YY are affected. This can be accommodated during calibration by placing the appropriate value of -Q in place of V in the source (SU) table. This has been simplified for people working in the 21cm band by incorporating the correct flux settings in the CALC function of the locally available AIPS program SETVY (rather than SETJY), which also recognizes the polarized source 3C138. The AIPS task CALIB will make use of the Stokes V values in the SU table to calculate gains. Things are simpler if only 3C48 or 3C147 are used for absolute flux calibration, since these sources have negligible linear polarization.

The source, a binary compiled under Linux, and the .HLP file of SETVY are available here (.tgz archive will extract into a directory WSRTAIPS containing the files).

What follows is a step by step guide to simple calibration of a WSRT database which has already been converted to a standard coordinate system (with j2convert) and been written as UVFITS (with ms2uvfits) including the writesyscal option (for TY and GC tables). We first consider simple gain and bandpass calibration and then consider simple polarization calibration.

  • read UVFITS with FITLD for the calibration sources and field of interest in the time order of observation
  • use PUTHEAD to set SORTORD to 'TB' in each (the data are really in this sort order but many tasks want to know this in the header)
  • use PUTHEAD to set CRVAL2 to -1 in each (this redefines the polarization products which were measured)
  • run INDXR with CPARM=0,0,1 on each (makes NX and basic CL tables) with one minute gain table entries (important for pol. calibration)
  • run APCAL on each (makes SN table from the TY and GC tables which contain info on system temperature variations during the obs.)
  • use DBCON to concatenate (two at a time) all calibrator and source fields in time sequence (this only retains the SN table from the very first file in the sequence)
  • use INDXR on the result
  • use TACOP to copy all additional SN tables to the combined file
  • use PRTAB to check that all SN tables have a consistent day number
  • use TABED if necessary to edit those SN tables which are completely on a new UT day, by adding one to the UT day number
  • use CLCAL to smooth, merge and apply the SN tables for Tsys calibration, using for example SAMPTYP 'MWF' and BPARM 0.2 to smooth over the odd glitch, producing CL.2
  • use SNPLT to examine CL.2 and repeat CLCAL with other parameters if necessary. The idea here is to calibrate out the systematic changes in the system gain with elevation and sky background. Only smooth variations with position are believable.
  • use SPFLG on at least one short baseline, eg. 10-11 (corresponding to RT9-RTA) to get a feel for the presence of interference and determine which spectral channels can serve as the continuum
  • if time permits use SPFLG to inspect all baselines and all polarization products and flag where needed (this is highly recommended!!)
  • use BPASS to determine the bandpass calibration (use the divide by channel zero option, BPASSPRM(5)=0, and normalization, BPASSPRM(10)=3)
  • use POSSM to inspect BP solutions and repeat BPASS if needed
  • use SPLAT to form a continuuum file for gain calibration (default CHANSEL give central 75% of band) applying the BPASS solutions
  • use INDXR on the result
  • use TVFLG to flag the continuum file (remember to flag all data which suffers from shadowing)
  • use SETJY to set the flux of at least one calibrator. (The locally available variant SETVY can be used to set all four modified Stokes parameters of 3C286 or 3C138 as noted above.)
  • use CALIB (with DOCALIB 1 to make use of the Tsys calibration that has already been determined).
  • use LISTR to inspect gain solutions (edit data as needed and repeat CALIB)
  • use GETJY to get any missing calibrator fluxes
  • use CLCAL with the specific SN version created by CALIB and GAINVER=2, GAINUSE=3 to create a new CL.3
  • use IMAGR to examine source field, if sufficient continuum flux is available do some self-cal
  • use TACOP to copy CL.3 and FG tables to the line database
  • use SPLIT to apply cal and combine polarizations
  • use IMAGR to image
  • use PUTHEAD to change the keyword CTYPE1 to RA---NCP and CTYPE2 to DEC--NCP
  • ...
  • for POLARIZATION calibration proceed as above up to the point of running CALIB and then ...
  • use CALIB (with DOCALIB 1, GAINUSE=2 to make use of the Tsys calibration that has already been determined) to determine 'A&P' solutions for all calibration sources that have been observed. It is important to use a short solution time interval, equal to the integration time (usually 60 sec) which implies having set CPARM=0,0,1 when running the first INDXR for each data file.
  • use LISTR to inspect gain solutions (edit data as needed and repeat CALIB)
  • use GETJY to get any missing unpolarized calibrator fluxes
  • use CLCAL with the specific SN version created by CALIB and GAINVER=2, GAINUSE=3 to create a new CL.3
  • use LPCAL to determine polarization leakage solutions from a bright unpolarized calibration sources (DOCAL 1, SOLINT 0). The antenna table of the input database will be modified to include the derived leakage information by LPCAL
  • use LISTR with DOCAL 1, DOPOL 1, OPTYE 'MATX', DPARM 1, STOKE 'POLC' to determine the average phase of 'RL' and conjugate of 'LR' of each polarized calibration source in each observed IF band one at a time
  • the average 'RL' and conjugate 'LR' phase should be approximately equal. Different linearly polarized sources may be offset by 180 degree from one another, but should otherwise be consistent with this value. Different IF's each have an independent phase. Calculate the average 'LR' phase value for each source and IF.
  • Recall that the real Stokes (I,Q,U,V) corresponds to requesting AIPS Stokes (I,-V,-Q,U). The negative sign implies asking AIPS for the positive quantity, but checking for a 180 degree phase in the result. The correct values for 3C286 near 1400 MHz are about (I,Q,U,V)=(14.65,0.56,1.26,0.00) Jy and for 3C138 near 1400 MHz are about (I,Q,U,V)=(8.30,0.63,-0.17,0.00) Jy. The implication is that the desired 'RL' phase for 3C286 is 180 degrees (which yields a negative sign) while the desired 'RL' phase for 3C138 is 0 degrees (yielding a positive sign).
  • use CLCOR with OPCODE 'POLR', GAINVER 4 and CLCORPRM = to the average 'LR' phase value plus 180 deg. (for 3C286 data) or plus 0 deg. (for 3C138 data) for each IF. CLCOR will make CL.5 and update the AN table with these phase differences.
  • use LISTR with DOCAL 1, DOPOL 1, OPTYE 'MATX', DPARM 1, to check that all polarized and unpolarized calibration sources have the correct real Stokes (I,Q,U,V) values, including sign.
  • use TACOP to copy CL.5, AN and FG tables to the line database
  • use SPLIT to apply pol. and gain calibration
  • use IMAGR to image
  • use PUTHEAD to change the keyword CTYPE1 to RA---NCP and CTYPE2 to DEC--NCP.
  • ...

For more detailed information, please contact the sciencesupport [at] astron [dot] nl (WSRT support team).

Design: Kuenst.    Development: Dripl.    © 2022 ASTRON