4.5 Antenna-based complex gain solutions

At this point, we assume that you have removed the worst of the bad calibrator data (if any) and have run CALIB over as large a UVRANGE as possible for each calibrator. The resulting gain tables can be brought to a consistent amplitude scale, bootstrapping the unknown fluxes of the secondary calibrators. Final pass(es) of CALIB are done if needed and then the solution tables are merged into a full calibration (CL) table.

4.5.1 Bootstrapping secondary flux-density calibrators

Task GETJY can be used to determine the flux density of the secondary flux calibrators from the primary flux calibrator based on the flux densities set in the SU table and the antenna gain solutions in the SN tables. The SU and SN tables will be updated by GETJY to reflect the calculated values of the secondary calibrators’ flux densities. This procedure should also work if (incorrect) values of the secondary calibrators’ flux densities were present in the SU table when CALIB was run. Bad or redundant SN tables should be deleted using EXTDEST before running GETJY, or avoided by selecting tables one at a time with adverb SNVER.

To use GETJY:


> SOURCES cal1’ , ’cal2’ , ’cal3  C R

to select secondary flux calibrators.

> CALSOU ’3C286’ , ’ ’  C R

to specify primary flux calibrator(s).


to use all calibrator codes.

> BIF 1 ; EIF 2  C R

to do both IFs.


to use FQ number 1.


to include solutions for all antennas.


to include all times.

> SNVER 0  C R

to use all SN tables.

> INP  C R

to review inputs.

> GO  C R

to run the task when the inputs are okay.

GETJY will give a list of the derived flux densities and estimates of their uncertainties. These are now found by “robust” methods and additional information about numbers of aberrant solutions are given. If any of the uncertainties are large, then reexamine the SN tables as described above and re-run CALIB and/or GETJY as necessary. Multiple executions of GETJY will not cause problems as previous solutions for the unknown flux densities are simply overwritten. You may wish to run the task SOUSP to determine the spectral indices of your calibrators from their fluxes in the SU table. You can even replace the values in the SU table with the curve fit by SOUSP and, in 31DEC15 correct the gains in one or more SN tables with the newly determined fluxes. These spectral index parameters may be useful in running BPASS and PCAL. However, BPASS knows the flux coefficients for all standard calibration sources and can fit the spectral index of other calibration sources from the SU table.

4.5.2 Full calibration

Once you have determined the flux densities of all your gain calibrators, you are ready to complete the first pass of the calibration. At this point, many observers take a conservative viewpoint and delete their existing SN table(s) with


to specify the SN table.

> INVERS -1  C R

to delete all versions.


to do the deletion.

This step forces you to re-run CALIB for all your gain calibration sources and is not required if the previous bootstrapping calibrations included all antennas and most correlators, for these calibrators.

Procedure VLACALIB may be used for your gain calibration sources as you did previously.

> INDI n ; GETN m  C R

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

> CALSOUR = ’aaaa’ , ’xxxx  C R

to name two calibration sources using the same UVRANGE.

> 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.


reference antenna number.


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


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


to dispense with all the print out this time.


use FQ number 1.


to review inputs.


to make the solution and print results.

If there are different uv ranges for different sources, then re-run the procedure with changed parameters, such as:

> CALSOUR = ’cal1’ , ’cal2’ , ’cal3  C R

to name secondary flux calibrator(s).


solutions for all antennas.


no uv limits, or range if any, in kiloλ.


to review inputs.


to process the secondary calibrators.

At this time, you should use as many antennas and as large a UVRANGE as you can for each calibrator, consistent with its spatial structure.

4.5.3 Final (?) initial global calibration

At this point you should have gain and phase solutions for the times of all calibration scans, including the correct flux densities for the secondary calibrators. The next step is to interpolate the solutions derived from the calibrators into the CL table for all the sources. CLCAL may be run multiple times if subsets of the sources are to be calibrated by corresponding subsets of the calibrators, unless you limit it to one or more tables with SNVER and INVERS, CLCAL assumes that all SN tables contain only valid solutions and concatenates all of the SN tables with the highest numbered one. Therefore, any bad SN tables should be removed before using CLCAL. For polarization calibration, it is essential that you calibrate the primary flux calibrator (3C48 or 3C286) also so that you can solve for the left minus right phase offsets and apply PCAL.

CLCAL has caused considerable confusion and user error because it implements to somewhat contrary views of its process. The older view, represented by previous versions of this CookBook, had the user gradually building a final CL table from multiple runs of CLCAL, each with a selected set of calibration sources, target sources, antennas, time ranges, and so forth. In this scheme, the user had to take great care that the final CL table actually contained information for all antennas, sources, and times for which it would be needed. It was easy to get this wrong! The second and now prevailing view is that every execution of CLCAL should write a new CL table containing all sources, antennas, and times, but with a selected subset modified by the current execution. This leads to there being a potentially large number of CL tables, but no data will be flagged due to the absence of data in the CL table. The user will still have to be careful to insure that all CL records have received the needed calibration information.

To use CLCAL:


to review the inputs.

> SOURCES sou1’ , ’sou2’ , ’sou3’ ,  C R

sources to calibrate, ’ ’ means all.

> CALSOUR cal1’ , ’cal2’ , ’cal3’ ,  C R

calibrators to use for SOURCES.


use FQ number n.


to combine SN tables into a CL table, passing any records not altered this time.


to select the latest CL table as input.


to select a new output CL table.


to select the reference antenna; needed only if REFANT reset since CALIB was run.


to use linear interpolation of the possibly smoothed calibrations..


to do no time-smoothing before the interpolation.


to use boxcar smoothing, followed by interpolation.

> BPARM n , n  C R

to smooth, if BOX selected, with an n-hr long boxcar in amplitude and phase.


to replace failed solutions with smoothed ones but to use all previously good solutions without smoothing.

> INP  C R

to check inputs.

> GO  C R

to run CLCAL.

Calibrator sources may also be selected with the QUAL and CALCODE adverbs; QUAL also applies to the sources to be calibrated. Note that REFANT appears in the inputs because AIPS references all phases to those of the reference antenna. If none is given, it defaults to the one used in the most solutions.

The smoothing and interpolation functions in CLCAL have been separated into two adverbs and the smoothing parameters are now conveyed with BPARM and ICUT. In smoothing, the DOBLANK adverb is particularly important; it controls whether good solutions are replaced with smoothed ones and whether previously failed solutions are replaced with smoothed ones. One can select either or both.

Note that CLCAL uses both the GAINUSE and GAINVER adverbs. This is to specify the input and output CL table versions, which should be different. If you are building a single CL table piece by piece, then these must be set carefully and normally held fixed. In the more modern view, they are set to zero and the task takes the latest CL table as input and makes a new one. CL table version 1 is intended to be a “virgin” table, free of all injury from any calibration you do using the AIPS package. It may not always be devoid of information, as “on-line” corrections may be made and recorded here by some telescope systems, e.g., the VLBA. The VLA, through tasks FILLM or INDXR, can now put opacity and antenna gain information in this file. CLCAL and most other AIPS tasks are forbidden to over-write version 1 of the CL table. This protects it from modification, and keeps it around so that you may reset your calibration to the raw state by using EXTDEST to destroy all CL table extensions with versions higher than 1. Be careful doing this, since you rarely want to delete CL version 1. Should you destroy CL table version 1 accidentally, you may generate a new CL table version 1 with the task INDXR. This new CL table may contain the calibration generated from the weather and antenna gain files.

If you have any reason to suspect that the calibration has gone wrong — or if you are calibrating data for the first time — you should examine the contents of the output CL table. LISTR with OPTYPE = GAINwill print out the amplitudes and phases in the specified CL or SN table. Note that these tables can be very large. Use the SOURCES and TIMERANG adverbs to limit the output, or look at it on your terminal (DOCRT = 1) so that you can stop the display whenever you have had enough. Task SNPLT will provide you with a graphical display which may be easier on the eye. EVLA users may wish to examine the SY table with LISTR or SNPLT; bad Psum and Pdif values may point to areas of bad data.

The task EVASN may help you determine the degree of phase and amplitude coherence in your calibration table. A lack of coherence suggests that the calibration is rather uncertain.

The most important step in the calibration is your verification that everything has gone according to plan. To check this, you should produce matrix listings for all your calibrator sources. For simplicity in interpretation, limit each listing to the UVRANGE to which you limited the calibrator during calibration. Thus:


> DOCRT -1  C R

to direct output to the printer.

> SOURCES cal1’ , ’cal2’ , ’cal3’ ,  C R

to list all selected calibrators by name.

> UVRANGE uvmin uvmax  C R

uv limits, if any, in kiloλ.


to get the matrix form of listing.


to list with calibration applied.


TO point to the latest gain table.

> FREQID  n  C R

list data for FQ n.

> DPARM = 5 , 1 , 0  C R

to have amplitude and phase using scalar scan averaging.

> BIF 1; EIF 0  C R

to select all IFs, LISTR will loop over IFs.

> INP  C R

to review the inputs.

> GO  C R

to run the program when inputs set correctly.

The matrix average amplitudes for the calibrators in this listing should be very close to the values that you entered with SETJY (or which were derived by GETJY) and the phases in all rows and columns for these sources should be very close to zero.

If some rows and columns of the amplitude matrices are systematically different from the mean, the amplitude calibration for the associated antennas is imperfect. The reasons for this should be investigated. More flagging of visibilities, scans, or antennas, may be indicated. If the phase matrices have all elements near zero, then the phase calibration is in good shape. If some calibrators have discrepant phases and others do not, the discrepant calibrators are probably resolved. Note that you will not be able to detect errors in the assumed positions of your calibrators at this stage if you have used the usual 2-point interpolation of the calibration. Position errors in the calibrators have now become phase and position errors in the target sources.

ANBPL converts baseline-based data before or after calibration into antenna-based quantities. In particular, the calibrated weights are very sensitive to problems with amplitude calibration.


to select task and initialize all its parameters.

> IND m ; GETN n  C R

to specify the multi-source data set.


to DISPLAY both parallel-hand polarizations.


to select FQ value to image.

> BIF 1 ; EIF 0  C R

to select all IFs.

> BCHAN n ; ECHAN m  C R

to combine a range of channels.


to apply calibration.


to use highest numbered CL table.


to edit data.


to correct bandpass with time smoothing using table 1.

> BPARM 2, 17  C R

to plot weight versus time.

> NPLOTS 3 ; DOTV 1  C R

To plot 4 antennas per page on the TV.

> DOCRT 0  C R

to suppress printed versions of the antenna-based values.

> INP  C R

to review the inputs.

> GO  C R

to run ANBPL.

If the previous steps indicate serious problems and/or you are seriously confused about what you have done and you want to start the calibration again, you can use the procedure VLARESET from the RUN file VLAPROCS to reset the SN and CL tables.


to verify the data set to be reset.


to reset SN and CL tables.