4.3 Beginning the calibration

After loading the data to disk, it has been traditional to begin with a substantial session of data checking and editing. With data from the VLA, this is always time consuming and often not necessary. Nonetheless, it is probably a good idea to check for two specific kinds of problems before beginning the actual calibration. These are corrupted data in the first record of most scans and totally dead antennas. Many other problems in the data are quickly and easily diagnosed by carefully inspecting the solution tables produced from the calibrators on un-edited data. Missing antennas and erratic amplitudes due to sampling problems and RF interference can be spotted from the SN tables and the closure-error messages produced by CALIB. If you can’t spot errors from these, you may not need to edit the calibrator data. If the SN tables have well-behaved phases for most antennas and rapidly rotating phases for one or two, then you may need to apply baseline corrections rather than editing. See §4.4.4 for details of how to make antenna-position corrections.

The next section tells how to detect simple problems in the data and eliminate them to reduce the warnings from the calibration tasks. The following sections tell you how to enter fluxes for the primary calibrator sources and do a preliminary calibration for all calibrators. In so doing, you should generate one or more solution (SN) tables containing the complex gains at the times of the calibration observations. These tables may be examined for problems with the observations. If you find problems, then you need to edit the data or apply baseline corrections and should consult §4.4. If you do not find problems, you may proceed directly to §4.5. (Of course, you may decide to edit the data from your program sources at a later stage of the data reduction and have to return to §4.4 then.)

4.3.1 Initial editing

The warning messages from the calibrations described in the next sections may be reduced by flagging those antennas which were not actually working, but which were not flagged by the on-line system. Another problem that has plagued the VLA (and other interferometers) persistently is that the first record in scans can be corrupted; usually its amplitudes are lower than they should be. These data can be flagged using TVFLG or UVFLG, but this can be time consuming. The task EDITA described in §4.4.2 is now likely to be the best initial (and perhaps only) editing tool which you need. For a more traditional approach, we recommend that you do the following before beginning your regular data editing. Use the task LISTR on your terminal (to save time and paper) to see if you have the problem:

> TASK LISTR  C R

to set the data listing task

> INDI n ; GETN m  C R

to select the data set, n = 3 and m = 1 above.

> OPTYPE LIST  C R

to select column listing format

> ANTEN a1 , 0  C R

to select one reliable antenna to display.

> BASEL 0  C R

to select all baselines to this antenna.

> SOURCES ’ ’ ; CALCODE ’*’  C R

to select all calibrator sources only.

> TIMER 0  C R

to select all times.

> STOKES ’RR’  C R

to examine only one Stokes at a time.

> BIF 1 ; EIF BIF C R

to specify the “AC” IFs only; it is quicker to look at only 1 IF at a time although more than one can be listed in sequence.

> FREQID 1  C R

to select FQ number (each FQ number must be done separately).

> DOCRT 132  C R

to see full width display on the terminal. Use your window manager to stretch the window to 132 characters width.

> DOCALIB -1  C R

to turn off calibration.

> DPARM 0  C R

to select amplitudes with no averaging.

> INP  C R

to re-check all the inputs parameters.

> GO  C R

to start the task.

The task will prompt you for a  C R after each “page full” of output. When you have seen enough, enter Q. This display will let you determine whether the start-of-scan problem infects your data and, if so, how badly. If it is rare, forget it for now and use manual flagging methods later if needed. If it is widespread, use the AIPS task QUACK:

> TASK QUACK  C R

> SOURCES ’ ’  C R

to select all sources.

> TIMER 0  C R

to select all times.

> ANTENNAS 0  C R

to select all antennas.

> FLAGVER 1  C R

to insert flagging information in FG table 1.

> OPCODE ’BEG’  C R

flag first APARM(2) min of each scan.

> REASON ’BAD START OF SCAN  C R

reason for the flagging.

> APARM 0 , 1/6 , 0  C R

flag first 10 seconds of each scan.

> GO  C R

The display generated above will also allow you to determine quickly which antennas are absent, which antennas are present but dead, and, with more careful examination, which antennas are flaky and may need special consideration. “Dead” antennas are visible in this display as columns with small numbers — columns that differ by factors of two or so from the others are generally fine. To be thorough, it is probably best to check the other IF:

> BIF 2 ; EIF 2 C R

to specify the “BD” IFs.

> GO  C R

to run the program again.

as well as STOKES = ’LL’.

To remove the dead antennas, run UVFLG. For example, if antennas 6, 9, and 22 were bad for the full run in both IFs and Stokes, they could be deleted with

> TASK UVFLG’ ; INP  C R

to select the editor and check its inputs.

> TIMER 0  C R

to select all times.

> BIF 1 ; EIF 2  C R

to specify the “AC” and “BD” IFs.

> BCHAN 0 ; ECHAN 0  C R

to flag all channels.

> FREQID 1  C R

to flag only the present FQ number.

> ANTEN 6 , 9, 22  C R

to select the antennas.

> BASEL 0  C R

to select all baselines to these antennas.

> STOKES ’ ’  C R

to select all Stokes.

> REASON = ’ZOMBIE ANTENNA  C R

to set a reason.

> OUTFGVER 1  C R

to select the first (only) flag table.

> INP  C R

be careful with the inputs here!

> GO  C R

to run the task when ready.

4.3.2 Primary flux density calibrators

Careful measurements made with the D array of the VLA have shown that the Baars et al.2 formulę for “standard” calibration sources are in error slightly, based on the assumption that the Baars’ expression for 3C295 is correct. Revised values of the coefficients have been derived by Rick Perley and Brian Butler. Task SETJY has these formulae built into it, giving you the option (OPTYPE CALC) of letting it calculate the fluxes for primary calibrator sources 3C48, 3C123, 3C138, 3C147, 3C196, 3C286, 3C295, and 1934-638. The default setting of APARM(2) = 0) will calculate the flux densities based on Perley-Butler 2017 values which cover the range 50 MHz to 50 GHz for the primary calibrators:3C48, 3C138, 3C147, 3C286, and 3C295 plus 3C123 and 3C196, all with a number of synonyms. Other sources which will be computed, but which may not be good calibrator sources, are (one name each) J0444-2809, PictorA, 3C144 (Taurus A, Crab Nebula), 3C218 (Hydra A), 3C274 (Virgo A), 3C348 (Hercules A), 3C353, 3C380, 3C405 (Cygnus A), 3C444, and 3C461 (Cassiopeia A). The 3C name is the only one used in SETJY for those extra sources with a 3C name — the parenthetical remarks are here for clarity only. Most of the sources in the extra list have limits on the frequency range over which the function is valid; SETJY will tell you if the frequencies are out of range. Higher values of APARM(2) select older systems of coefficients if you need them to match previous data reductions. SETJY will recognize both the 3C and IAU designations (B1950 and J2000) for the standard sources. You may insert your own favorite values for these sources instead (OPTYPE = ’ ’) and you will have to insert values for any other gain calibrators you intend to use. Adverbs SPECINDX and SPECURVE allow you to enter spectral index information to help set the calibrator fluxes.

Unfortunately, since all the primary flux calibrators are resolved by the VLA in most configurations and at most frequencies, they cannot be used directly to determine the amplitude calibration of the antennas without a detailed model of the source structure, see Figure 4.1 as an example. Beginning in April 2004, model images for the calibrators at some frequencies are included with AIPS. Models of 3C286, 3C48, 3C138, and 3C147 are available for all 6 traditional bands of the VLA except 90 cm and even for S band of the EVLA. Type CALDIR  C R to see a list of the currently available calibrator models. Sources which are small enough to be substantially unresolved by the VLA have variable flux densities which must be determined in each observing session. A common method used to determine the flux densities of the secondary calibrators from the primary calibrator(s) is to compare the amplitudes of the gain solutions from the procedure described below.

Use SETJY to enter/calculate the flux density of each primary flux density calibrator. The ultimate reference for the VLA is 3C295, but 3C286 (1328+307), which is slightly resolved in most configurations at most frequencies, is the most useful primary calibrator. CALIB has an option that will allow you to make use of Clean component models for calibrator sources. You are strongly encouraged to use the existing models. If you follow past practice at the VLA, you may have to restrict the uv range over which you compute antenna gain solutions for 3C286, and may therefore insert a “phony” flux density appropriate only for that uv range at this point. In both cases, the following step should be done. CALIB will scale the total flux of the model to match the total flux of the source recorded by SETJY in the source table. This corrects for the model being taken at a somewhat different frequency than your observations and for the model containing most, but not all, of the total flux. An example of the inputs for SETJY, where you let it calculate the flux, would be:

> TASK SETJY’ ; INP  C R

> SOURCES ’3C286’ , ’ ’  C R

if you used 3C286 as the source name.

> BIF 1 ; EIF 2  C R

will calculate for both “AC” and “BD” IFs.

> OPTYPE CALC  C R

perform the calculation.

> APARM(2) = 0  C R

to use the VLA “2013” coefficients.

> INP  C R

to review inputs.

> GO  C R

when inputs okay.

Or you can set the flux manually as shown below:

> TASK SETJY’ ; INP  C R

> SOURCES ’3C286’ , ’ ’  C R

if you used 3C286 as the source name.

> ZEROSP 7.41 , 0  C R

I flux 7.41 Jy, Q, U, V fluxes 0.

> BIF 1 ; EIF 1  C R

selects first IF IF.

> INP  C R

to review inputs.

> OPTYPE  ’

use values given in ZEROSP.

> GO  C R

when inputs okay.

> BIF 2 ; EIF 2  C R

selects second IF IF.

> ZEROSP 7.46, 0  C R

I flux 7.46 Jy at the 2nd IF, Q, U, V fluxes 0.

> GO  C R

Note that, although SOURCES can accept a source list, ZEROSP has room for only one set of I, Q, U, V flux densities. To set the flux densities for several different sources or IFs, you must therefore rerun SETJY for each source and each IF, changing the SOURCES, BIF, EIF, and ZEROSP inputs each time. Alternatively, set ZEROSP to the flux at 1 GHz and enter SPECINDX and SPECURVE adverbs to describe the dependence with frequency.

CALIB will use the V polarization flux in the source table if one has been entered. The RR polarization will be calibrated to I+V and the LL to I-V. While this has little practical use with circular polarizations because V is almost always negligible, it can be used for linearly polarized data from the WSRT. That telescope has equatorially mounted dishes, so the XX polarization is I-Q and the YY is I+Q independent of parallactic angle. For WSRT data, you should relabel the polarizations to RR/LL and enter I, 0, 0, -Q for ZEROSP, since Q is not negligible in standard calibrators.

4.3.3 First pass of the gain calibration

4.3.3.1 Using calibrator models

It is now considered standard practice to use flux calibrator models and you are strongly encouraged to do so. As mentioned above, all the primary flux calibrators are resolved at most frequencies and configurations. Figure 4.1 shows the visibilities and image of the commonly used calibrator 3C48 at X-band, it is obvious this source is far from being point like. Since April 2004, source models have been shipped with AIPS as FITS files. Currently, models for 3C48, 3C286 and 3C137 are available for all bands except 90 cm and 3C147 at all bands except, X, C and 90 cm. Additional models are in the works, so you should always check to see what is available:

> CALDIR  C R

to list the available models by source name and band code.

The primary calibration task in AIPS is CALIB. Most of the complexity of CALIB can be hidden using the procedure VLACALIB. Before attempting to use this procedure, you must first load it by typing:

> RUN VLAPROCS  C R

to compile the procedures.

Type HELP VLAPROCS for a full list of the procedures available in VLAPROCS.

The procedure VLACALIB automatically downloads and uses calibrator models, if one is available and the inputs are set correctly. After you have loaded VLACALIB you may invoke the calibrator model usage by setting:

> INDI n ; GETN m  C R

to select the data set, n = 3 and m = 1 above.

> CALSOUR = ’Cala  C R

to name one primary flux calibrator to invoke automatic calibrator model usage.

> UVRANGE 0  C R

set to zero to invoke automatic calibrator model usage.

> ANTENNAS 0  C R

set to zero to invoke automatic calibrator model usage.

> REFANT n  C R

reference antenna number — use a reliable antenna located near the center of the array.

> MINAMPER 10  C R

display warning if baseline disagrees in amplitude by more than 10% from the model.

> MINPHSER 10  C R

display warning if baseline disagrees by more than 10 of phase from the model.

> FREQID 1  C R

use FQ number 1.

> DOPRINT 1 ; OUTPRINT    C R

to generate significant printed output on the line printer.

> INP VLACALIB  C R

to review inputs.

> VLACALIB  C R

to make the solution and print results.

This procedure load the will load the calibrator model (using CALRD) and use it when it runs CALIB, then print any messages from CALIB about closure errors on the line printer, and finally run LISTR to print the amplitudes and phases of the derived solutions. Plots of these values may be obtained using task SNPLT.

Alternatively, you can load the model in manually using CALRD :

> TASK CALRD  C R

to select the calibrator source reading task.

> OBJECT ’3C286’  C R

to load a model of 3C286.

> BAND ’K’  C R

to select the available model at K band.

> OUTDISK n  C R

to write the model image and Clean components to disk n.

> GO  C R

to run the task and load the model.

Then you may select the model image with GET2N for use in CALIB. Example inputs for CALIB are:

> TASK CALIB’; INP  C R

to select task and review inputs.

> INDI n ; GETN m  C R

to select the data set, n = 3 and m = 1 above.

> CALSOUR = ’Cala’ , ’   C R

flux calibrator for which you have a model.

> UVRANGE 0  C R

no uv limits needed.

> ANTENNAS 0  C R

antenna selection not needed.

> REFANT n  C R

reference antenna number — use a reliable antenna located near the center of the array.

> WEIGHTIT 1  C R

to select 1∕σ weights which may be more stable.

> IN2DI o ; GET2N p  C R

to select the model.

> NCOMP 0  C R

to use all components.

> SOLMODE ’A&P’  C R

to do amplitude and phase solutions.

> APARM(6) 2  C R

to print closure failures.

> MINAMPER 10  C R

to display warning if baseline disagrees in amplitude by more than 10% from the model.

> MINPHSER 10  C R

to display warning if baseline disagrees by more than 10 of phase from the model.

> CPARM(5) 1  C R

to vector average amplitudes over spetral channels and then scalar average them over time before determining solution.

> FREQID 1  C R

to use FQ number 1.

> INP CALIB  C R

to review inputs.

> GO  C R

to make the solution.

CALIB will use the clean components table attached to the model to find antenna gain solutions. It will sum the clean components within a certain radius of the center of the map (so that confusing sources that are part of the model do not influence the gain) and scale them to the flux in the SU table. Therefore, you must still run SETJY before running CALIB.

After running CALIB check the solutions for all antennas with SNPLT or LISTR (OPTYPE=’GAIN’). If you have multiple primary or secondary calibrators you will have to run CALIB separately for each, using models where they are available and restricting the UVRANGE and ANTENNAS where they are not. You can either write into the same SN table by setting SNVER to a table number or to different SN tables by setting SNVER = 0. Then you you can proceed as normal flagging and editing your data and proceed to final calibration as described in §4.5.


PIC   PIC

Figure 4.1: Displays of the visibilities (left) and image (right) for the fundamental calibration source 3C48. The plots were made using UVPLT, KNTR, and LWPLA; see §6.3.1 and §6.3.2.1. Data from all VLA configurations including the VLBA antenna in Pie Town were used. A point source would have visibilities that have a constant amplitude at all baselines and an image matching the beam plotted in the lower-left corner.


4.3.3.2 Flux calibration without calibrator models

We strongly encourage you to use the available models. If words alone do not convince you, we encourage you to look at Figure 4.1 which shows you the visibilities and image of 3C48 at X-band. It is rather far from a point source. At lower frequencies there are other sources in the field which have an effect on phases as well. This section used to list recommended UVRANGEs to use for the standard calibration sources. This is such bad practise that we have deleted those tables — use the models.

The values of UVRANGE for each secondary calibrator may be determined from the VLA Calibrator manual or by using UVPLT to plot the amplitudes as a function of baseline length. If your secondary calibrators are point sources over most baselines, then it may save you time to do the full calibration now. Not only will it save you, possibly, from re-running CALIB at a later time with a wider UVRANGE, but it will provide information on the data quality from the longer baselines.

Once you have read in procedure VLACALIB (see §4.3.3.1), you may use it to invoke CALIB. You will have to do this once for each calibrator, unless you can use the same UVRANGE for more than one of them. Thus,

> INDI n ; GETN m  C R

to select the data set, n = 3 and m = 1 above.

> CALSOUR = ’Cala’ , ’Calx  C R

to name two calibrators using the same UVRANGE and other adverb values.

> UVRANGE uvmin uvmax  C R

uv limits, if any, in kiloλ.

> ANTENNAS list of antennas  C R

antennas to use for the solutions, see discussion above.

> REFANT n  C R

reference antenna number — use a reliable antenna located near the center of the array.

> MINAMPER 10  C R

display warning if baseline disagrees in amplitude by more than 10% from the model.

> MINPHSER 10  C R

display warning if baseline disagrees by more than 10 of phase from the model.

> DOPRINT 1 ; OUTPRINT    C R

to generate significant printed output on the line printer.

> FREQID 1  C R

use FQ number 1.

> INP VLACALIB  C R

to review inputs.

> VLACALIB  C R

to make the solution and print results.

This procedure will first run CALIB, then print any messages from CALIB about closure errors on the line printer, and finally run LISTR to print the amplitudes and phases of the derived solutions. Plots of these values may be obtained using task SNPLT.

If the secondary calibrators require different values of UVRANGE, then CALIB must be run until it has run for all calibration sources. Attached to your input data set is a solution SN table. Each run of CALIB writes in this table (if SNVER = 1), for the times of the included calibration scans, the solutions for all IFs using the flux densities you set for your calibrators with SETJY or GETJY. (CALIB assumes a flux density of 1 Jy if no flux density is given in the SU table.) If a solution fails, however, the whole SN table can be compromised, forcing you to start over. It is possible to write multiple SN tables with SNVER = 0. Later programs such as GETJY and CLCAL will merge all SN tables which they find (if told to do so). Tables with failed solutions must be deleted.

The LISTR outputs provided by VLACALIB should be examined carefully to check on the calibration; amplitudes should be consistent (both among antennas and among time stamps) and phases should vary smoothly. If you decide that the solutions are not acceptable (e.g., there are no valid solutions) and you are creating a new SN table on each run of CALIB, then delete that SN table using EXTDEST before proceeding. The later stages of processing assume that all extant SN tables are valid. Note that re-running CALIB on the same SN table simply over-writes the old solutions with new ones. CALIB gives messages which indicate the number of valid and invalid solutions which should help you evaluate the results. If VLACALIB is run using the values of MINAMPER and MINPHSER shown above, it will print a list of baselines and times which show substantial “closure” errors. (If you use CALIB directly rather than VLACALIB, you may use these adverbs plus CPARM(2-4) to get additional reports and statistics on closure errors and CPARM(7) to limit reporting of individual closure errors.) It is important to remember that normal thermal noise and, at longer wavelengths, background confusion cause closure errors too. Thus, some closure error on weaker calibrators is to be expected and may be ignored. CALIB will ignore errors larger than MINAMPER and MINPHSER if the data weights (after application of the source model) indicate that they have significance less than CPARM(7) times the expected error. Interpreting closure errors is a real art, but a couple of generalizations are possible. If the same closure error shows up in both polarizations and both IFs, then you have probably got a resolved object. If one antenna dominates the closure list, especially if it is at only one IF and/or one polarization, then you have got a bad antenna. If the errors are uniformly small, distributed amongst all antennas, and not correlated between IFs or polarizations, then you have simply noise and/or background confusion. In this case, do not edit the data — the randomness of the “errors” nearly always averages out nicely and the solution is just fine. Large or systematic errors indicate either that the calibrator source is resolved or that there are problems with the data requiring editing. If a calibrator is being resolved, delete the bad SN table and re-run VLACALIB with an appropriate UVRANGE. One can now actually flag data based on closure errors using the DOFLAG option. This should be used carefully, if at all and then only if the model of the calibration source contains all of its flux. Modern versions of CALIB display some statistics of closure problems automatically and allow the use of “robust” solution methods.