NRAO Home > CASA > CASA Toolkit Reference Manual
calibrater.setapply - Function

2.2.1 Arrange to apply calibration


Description

This function is used to specify the calibration components which should be applied during subsequent execution of the solve and correct functions. This function should be executed as many times as necessary to specify all desired calibration components.

Each calibration component represents a separate calibration matrix correction included in the measurement equation. The different types correspond to different instrumental and atmospheric effects. Calibration components are available as calibration tables generated by previous solve executions (types ’B’,’BPOLY’,’G’,’GSPLINE’, ’D’,’DF’,’T’,’M’,’MF’,’X’), or are calculated analytically on the fly (types ’P’, ’TOPAC’, ’GAINCURVE’). Upon execution of solve or correct, the group of specified calibration components will be applied in the order prescribed by the Measurement Equation formalism.

The parameters are as follows:

type
The calibration type being specified. This is only required for analytic types (’P’,’TOPAC’,’GAINCURVE’). When specifying an existing pre-solved calibration table, it is not necessary to explicitly specify the type; this will be discerned from the table. (Specifying the type as well as the table will force a check that the table contains solutions of the specified type.

For type=’GAINCURVE’, an elevation-dependent correction will be applied using parameters read from the data repository. Currently, this is only supported for the VLA.

t
This parameter will be used in a future release to control the range of applicability of the specified calibration. Currently, it is ignored.
table
For pre-solved calibration, the file name of the table to apply.
field
The fields to select from the specified table, using MS Selection syntax (as in selectvis).
interp
The desired type of time-dependent interpolation. Use interp=’nearest’ to calibrate each datum with the calibration value nearest in time. Use interp=’linear’ to calibrate each datum with calibration phases and amplitudes linearly interpolated from neighboring (in time) values. In the case of phase, this mode will assume that phase jumps greater than 180 degrees between neighboring points indicate a cycle slip, and the interpolated value will follow this change in cycle accordingly (i.e., the implied rate will always be less than 180 degrees per sample). Use interp=’aipslin’ to emulate the basic interpolation mode used in classic AIPS, i.e., linearly interpolated amplitudes, with phases derived from linear interpolation of the complex calibration values. While this method avoids having to track cycle slips (which is unstable for solutions with very low SNR), it will yield a phase interpolation which becomes increasingly non-linear as the spanned phase difference increases. The non-linearity mimics the behavior of interp=’nearest’ as the spanned phase difference approaches 180 degrees (the phase of the interpolated complex calibration value initially changes very slowly, then rapidly jumps to the second value at the midpoint of the interval). If the uncalibrated phase is changing this rapidly, a ’nearest’ interpolation is not desirable. Usually, interp=’linear’ is the best choice. The interp parameter is applicable to any calibration type, as long as there are sufficient solutions available to perform the interpolation. Note that calibration solutions which have been determined for only one timestamp will default to ’nearest’. More interpolation options (e.g., ’cubic’) will be added in the future.
select
Used to specify general selection of a subset of calibration measurements from the table to be applied to the visibility data. Arbitrary cross-calibration is possible by combining this function with the setdata function. The string specified must be a valid TaQL expression.
spwmap
This parameter is used to indicate how solutions derived from different spectral windows should be applied to other spectral windows. Nominally, data in each spectral window will be corrected by solutions derived from the same spectral window. This is the default behavior of spwmap, i.e., if spwmap is not specified, calibrater will insist that data be corrected by solutions from the same spw. Otherwise, spwmap takes a vector of integers indicating which spectral window solutions to apply to which spectral window data, such that spwmap[j]=i causes solutions derived from the i-th spectral window to be used to correct the j-th spectral window. For example, if (say) bandpass solutions are available for spws 0 & 2, and it is desired that these be applied to spws 1 & 3 (as well as 0 & 2), respectively, use spwmap=[0,0,2,2]. Even if some spws do not require an explicit spwmap setting, yet one or more does, it is safest to specify it explicitly for all, e.g., spwmap=[0,1,3,3] indicates that spw 2 will be corrected with solutions from spw 3, and the others will behave nominally. Note that if no solutions exist for any of the spws specified in spwmap, an error message will result.
calwt
If set True, the data weights will be calibrated along with the data. This is usually desirable.
opacity
For type=’TOPAC’, an elevation-dependent opacity correction will be applied according to the zenith opacity value supplied in the opacity parameter. Currently, only one zenith opacity value can be supplied, and it is used for all antennas.

Use the state function to review the list of calibration components that have been set for application.

Pending improvements:

Arguments





Inputs

type

Component type

allowed:

string

Default:

B

BPOLY

G

GSPLINE

D

P

T

TOPAC

GAINCURVE

t

Interpolation interval (seconds)

allowed:

double

Default:

0.0

table

Calibration table name

allowed:

string

Default:

field

Select on field

allowed:

any

Default:

variant

interp

Interpolation type (in time)

allowed:

string

Default:

aipslin

nearest

linear

select

TAQL selection string. Default is no selection.

allowed:

string

Default:

calwt

Calibrate weights?

allowed:

bool

Default:

false

spwmap

Spectral windows to apply

allowed:

intArray

Default:

-1

opacity

Array-wide zenith opacity per antenna (for type=’TOPAC’)

allowed:

doubleArray

Default:

0.0

Returns
bool

Example

 
 
cb.open(’ngc5921.ms’)  
cb.selectvis(field=’N5921*’)  
cb.setapply (type=’G’, table=’gcal’, field=’1445*’)  
cb.setapply (type=’P’)  
cb.correct();  
cb.close();  
 
 
In this example, we apply parallactic angle corrections and a gain  
calibration derived from a field whose name matches ’1445*’ in a caltable  
called ’gcal’ to data for a field matching ’N5921*’  

__________________________________________________________________


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