|
|||
NRAO Home > CASA > CASA Cookbook and User Reference Manual |
|
4.6.1 Application of Calibration (applycal)
After all relevant calibration types have been determined, they must be applied to the target source(s) before splitting off to a new MS or before imaging. This is currently done by explicitly taking the data in the DATA column in the MAIN table of the MS, applying the relevant calibration tables, and creating the CORRECTED_DATA scratch column. The original DATA column is untouched.
The applycal task does this. The inputs are:
vis = ’’ # Name of input visibility file
field = ’’ # Select field using field id(s) or field name(s)
spw = ’’ # Select spectral window/channels
intent = ’’ # Select observing intent
selectdata = True # Other data selection parameters
timerange = ’’ # Select data based on time range
uvrange = ’’ # Select data within uvrange (default units meters)
antenna = ’’ # Select data based on antenna/baseline
scan = ’’ # Scan number range
observation = ’’ # Select by observation ID(s)
msselect = ’’ # Optional complex data selection (ignore for now)
gaintable = [’’] # Gain calibration table(s) to apply on the fly
gainfield = [’’] # Select a subset of calibrators from gaintable(s)
interp = [’’] # Interp type in time[,freq], per gaintable.
# default=linear,linear
spwmap = [] # Spectral windows combinations to form for gaintables(s)
gaincurve = False # Apply internal VLA antenna gain curve correction
opacity = [] # Opacity correction to apply (nepers), per spw
parang = False # Apply parallactic angle correction
calwt = True # Calibrate data weights from all relevant calibrations
flagbackup = True # Automatically back up the state of flags before the run?
async = False # If true the taskname must be started using applycal(...)
As in other tasks, setting selectdata=True will open up the other selection sub-parameters (see § 2.3). In addition, you can also select data based on the scan intents that were set during the observations (find them through listobs). Many of the other parameters are the common calibration parameters that are described in § 4.4.1.
The single non-standard parameter is the calwt option to toggle the ability to scale the visibility weights by the inverse of the products of the scale factors applied to the amplitude of the antenna gains (for the pair of antennas of a given visibility). This should in almost all cases be set to its default (True). The weights should reflect the inverse noise variance of the visibility, and errors in amplitude are usually also in the weights.
Alert: Current (as of June 2010) JVLA data has no weights to the data. To avoid trouble, calwt=False should be set for those data sets. Older VLA data should still be calibrated with calwt=True.
For applycal, the list of final cumulative tables is given in gaintable. In this case you will have run accum if you have done incremental calibration for any of the types, such as ’G’. You can also feed gaintable the full sets and rely on use of gainfield, interp and spwmap to do the correct interpolation and transfer. In particular, for frequency interpolation, the interpolation methods ending in ’PD’, nearestPD and linearPD also scale the phase by the frequency ratio between the measured and interpolated values. It is often more convenient to go through accumulation of each type with accum as described above (see § 4.5.5.2), as this makes it easier to keep track of the sequence of incremental calibration as it is solved and applied. You can also do any required smoothing of tables using smoothcal (§ 4.5.4), as this is not yet available in accum or applycal.
applycal will flag all data that have no calibration solution. Flags will distribute into all of your scratch columns, ie. it will affect your uncalibrated visibilities, too. To be able to restore the flags to the state before applycal is starting its duty, the task will make a backup of your current flags by default (flagbackup=True). Restore them with flagmanager, if you are not happy with the applycal results.
If you are not doing polarization calibration or imaging, then you can set parang=False to make the calculations faster. If you are applying polarization calibration, or wish to make polarization images, then set parang=True so that the parallactic angle rotation is applied to the appropriate correlations. Currently, you must do this in applycal as this cannot be done on-the-fly in clean or mosaic. See § 4.4.1.3 for more on parang.
For example, to apply the final bandpass and flux-scaled gain calibration tables solutions to the NGC5921 data:
vis=’ngc5921.usecase.ms’
# We want to correct the calibrators using themselves
# and transfer from 1445+099 to itself and the target N5921
# Start with the fluxscale/gain and bandpass tables
gaintable=[’ngc5921.usecase.fluxscale’,’ngc5921.usecase.bcal’]
# pick the 1445+099 (field 1) out of the gain table for transfer
# use all of the bandpass table
gainfield = [’1’,’*’]
# interpolation using linear for gain, nearest for bandpass
interp = [’linear’,’nearest’]
# only one spw, do not need mapping
spwmap = []
# all channels, no other selection
spw = ’’
selectdata = False
# no prior calibration
gaincurve = False
opacity = 0.0
# select the fields for 1445+099 and N5921 (fields 1 and 2)
field = ’1,2’
applycal()
# Now for completeness apply 1331+305 (field 0) to itself
field = ’0’
gainfield = [’0’,’*’]
applycal()
# The CORRECTED_DATA column now contains the calibrated visibilities
In another example, we apply the final cumulative self-calibration of the Jupiter continuum data obtained in the example of § 4.5.5.2:
gaintable=’jupiter6cm.usecase.selfcal1’,
selectdata=False)
Again, it is important to remember the relative nature of each calibration term. A term solved for in the presence of others is, in effect, residual to the others, and so must be used in combination with them (or new versions of them) in subsequent processing. At the same time, it is important to avoid isolating the same calibration effects in more than one term, e.g., by solving for both ’G’ and ’T’ separately (without applying the other), and then using them together.
It is always a good idea to examine the corrected data after calibration (using plotxy to compare the raw (’data’) and corrected (’corrected’) visibilities), as we describe next.
More information about CASA may be found at the
CASA web page
Copyright © 2010 Associated Universities Inc., Washington, D.C.
This code is available under the terms of the GNU General Public Lincense
Home |
Contact Us |
Directories |
Site Map |
Help |
Privacy Policy |
Search