NRAO Home > CASA > CASA Task Reference Manual

0.1.2 applycal

Requires:

Synopsis
Apply calibrations solutions(s) to data

Description

Applycal reads the specified gain calibration tables, applies them to the (raw) data column (with the specified selection), and writes the calibrated results into the corrected column. This is done in one step, so all available calibration must be specified. Applycal will overwrite existing corrected data.

Standard data selection is supported. See help par.selectdata for more information.

One or more calibration tables (both temporal, frequency, polarization calibrations) can be specified in the gaintable parameter. The calibration values associated with a restricted list of fields can also be selected for each table.

See task accum for instructions on forming calibration incrementally. See task split for saving corrected data in another visibility file.



Arguments





Inputs

vis

Name of input visibility file

allowed:

string

Default:

field

Select field using field id(s) or field name(s)

allowed:

string

Default:

spw

Select spectral window/channels

allowed:

string

Default:

intent

Select observing intent

allowed:

string

Default:

selectdata

Other data selection parameters

allowed:

bool

Default:

True

timerange

Select data based on time range

allowed:

string

Default:

uvrange

Select data within uvrange (default units meters)

allowed:

any

Default:

variant

antenna

Select data based on antenna/baseline

allowed:

string

Default:

scan

Scan number range

allowed:

string

Default:

observation

Select by observation ID(s)

allowed:

any

Default:

variant

msselect

Optional complex data selection (ignore for now)

allowed:

string

Default:

docallib

Use callib or traditional cal apply parameters

allowed:

bool

Default:

False

callib

Cal Library filename

allowed:

string

Default:

gaintable

Gain calibration table(s) to apply on the fly

allowed:

stringArray

Default:

gainfield

Select a subset of calibrators from gaintable(s)

allowed:

stringArray

Default:

interp

Interp type in time[,freq], per gaintable. default==linear,linear

allowed:

stringArray

Default:

spwmap

Spectral windows combinations to form for gaintables(s)

allowed:

intArray

Default:

calwt

Calibrate data weights per gaintable.

allowed:

boolArray

Default:

True

parang

Apply parallactic angle correction

allowed:

bool

Default:

False

applymode

Calibration mode: ””=”calflag”,”calflagstrict”,”trial”,”flagonly”,”flagonlystrict”, or ”calonly”

allowed:

string

Default:

flagbackup

Automatically back up the state of flags before the run?

allowed:

bool

Default:

True

Example

 
 
 
       Applycal reads the specified gain calibration tables or cal library,  
       applies them to the (raw) data column (with the specified selection),  
       and writes the calibrated results into the corrected column.  
       This is done in one step, so all available calibration tables must  
       be specified.  
 
       Applycal will overwrite existing corrected data, and will flag data  
       for which there is no calibration available.  
 
       In the traditional interface (docallib=False), all calibration  
       tables (both temporal, frequency, polarization  
       calibrations) are specified in the gaintable parameter.  The  
       calibration values associated with a restricted list of fields  
       can also be selected for each table in gainfield.  
 
       As of CASA v4.2, docallib=True provides specification of an  
       ensemble of calibration tables and directives via a cal  
       library file.  
 
       See task accum for instructions on forming calibration  
       incrementally.  See task split for copying out any portion of the data  
       and selected columns to a new visibility file.  
 
       Keyword arguments:  
       vis -- Name of input visibility file  
               default: < none>; example: vis=’ngc5921.ms’  
 
      --- Data Selection: the data to which the calibration will be applied  
        (see help par.selectdata for more detailed information)  
 
      field -- Select field id(s) or field name(s) to apply calibration.  
                 [run listobs to obtain the list id’s or names]  
               default: ’’=all fields  
               If field’s string is an integer >=0, it is assumed to be an index  
                 otherwise, it is assumed to be a field name  
               field=’0~2’; field ids 0,1,2  
               field=’0,4,5~7’; field ids 0,4,5,6,7  
               field=’3C286,3C295’; fields named 3C286 and 3C295  
               field = ’3,4C*’; field id 3, all names starting with 4C  
      spw -- Select spectral window/channels  
               type ’help par.selection’ for more examples.  
             spw=’0~2,4’; spectral windows 0,1,2,4 (all channels)  
             spw=’<2’;  spectral windows less than 2 (i.e. 0,1)  
             spw=’0:5~61’; spw 0, channels 5 to 61, INCLUSIVE  
             spw=’*:5~61’; all spw with channels 5 to 62  
             spw=’0,10,3:3~45’; spw 0,10 all channels, spw 3, channels 3 to 45.  
             spw=’0~2:2~6’; spw 0,1,2 with channels 2 through 6 in each.  
             spw=’0:0~10;15~60’; spectral window 0 with channels 0-10,15-60  
                       NOTE ’;’ to separate channel selections  
             spw=’0:0~10^2,1:20~30^5’; spw 0, channels 0,2,4,6,8,10,  
                   spw 1, channels 20,25,30  
       intent -- Select observing intent  
                 default: ’’  (no selection by intent)  
                 intent=’*BANDPASS*’  (selects data labelled with  
                                       BANDPASS intent)  
       selectdata -- Other data selection parameters  
              default: True  
       timerange  -- Select data based on time range:  
              default = ’’ (all); examples,  
              timerange = ’YYYY/MM/DD/hh:mm:ss~YYYY/MM/DD/hh:mm:ss’  
              Note: if YYYY/MM/DD is missing, date defaults to first day in  
                    data set  
              timerange=’09:14:0~09:54:0’ picks 40 min on first day  
              timerange= ’25:00:00~27:30:00’ picks 1 hr to 3 hr 30min on next day  
              timerange=’09:44:00’ data within one integration of time  
              timerange=’>10:24:00’ data after this time  
       uvrange -- Select data within uvrange (default units meters)  
              default: ’’ (all); example:  
              uvrange=’0~1000klambda’; uvrange from 0-1000 kilo-lambda  
              uvrange=’>4klambda’;uvranges greater than 4 kilolambda  
       antenna -- Select data based on antenna/baseline  
              default: ’’ (all)  
              If antenna’s string is an integer >=0, it is taken to be an index  
                otherwise, it is assumed to be an antenna name  
              antenna=’5&6’; baseline between antenna index 5 and index 6.  
              antenna=’VA05&VA06’; baseline between VLA antenna 5 and 6.  
              antenna=’5&6;7&8’; baseline 5-6 and 7-8  
              antenna=’5’; all baselines with antenna index 5  
              antenna=’05’; all baselines with antenna name 05--vla antenna 5.  
              antenna=’5,6,10’; all baselines with antennas 5,6 and 10  
       scan -- Scan number range  
       observation -- Select by observation ID(s).  
                       default: ’’ = all  
                       example: ’0~3,6’  
       msselect -- Optional complex data selection (ignore for now)  
 
       --- Calibration files to apply  
       docallib -- Control means of specifying the caltables:  
               default: False ==> Use gaintable,gainfield,interp,spwmap,calwt  
                        If True, specify a file containing cal library in callib  
       callib -- If docallib=True, specify a file containing cal  
                  library directives  
       gaintable -- Gain calibration table(s) to apply  
               default: ’’ (none);  
               examples: gaintable=’ngc5921.gcal’  
                   gaintable=[’n5921.ampcal’,’n5921.phcal’,’n5921.bpass’]  
               All gain table types: ’G’, GSPLINE, ’T’, ’B’, ’BPOLY’, ’D’s’  
                   can be applied.  
       gainfield -- Select a subset of calibrators from each gaintable  
               default:’’ ==> all sources in table;  
               ’nearest’ ==> nearest (on sky) available field in table  
               otherwise, same syntax as field  
               example: gainfield=’0~3’  
                        gainfield=[’0~3’,’4~6’]  (for multiple gaintables)  
       interp -- Interpolation type (in time[,freq]) to use for each gaintable.  
                When frequency interpolation is relevant (bandpass solutions,  
                frequency-dependent polcal solutions, ALMA Tsys)  
                separate time-dependent and freq-dependent interp  
                types with a comma (freq _after_ the comma).  
                Specifications for frequency are ignored when the  
                calibration table has no channel-dependence.  
                Time-dependent interp options ending in ’PD’ enable a  
                "phase delay" correction per spw for non-channel-dependent  
                calibration types.  
                For multi-obsId datasets, ’perobs’ can be appended to  
                the time-dependent interpolation specification to  
                enforce obsId boundaries when interpolating in time.  
                Add ’flag’ to the freq-dependent interpolation options  
                to enforce channel-dependent flagging (rather than  
                interpolation/extrapolation).  
                default: ’’ --> ’linear,linear’ for all gaintable(s)  
                example: interp=’nearest’   (in time, freq-dep will be  
                                             linear, if relevant)  
                         interp=’linear,cubic’  (linear in time, cubic  
                                                 in freq)  
                         interp=’linearperobs,splineflag’ (linear in time  
                                                          per obsId,  
                                                          spline in  
                                                          freq with  
                                                          channelized  
                                                          flagging)  
                         interp=’,spline’  (spline in freq; linear in  
                                            time by default)  
                         interp=[’nearest,spline’,’linear’]  (for multiple gaintables)  
                Options: Time: ’nearest’, ’linear’, ’nearestPD’, ’linearPD’  
                         Freq: ’nearest’, ’linear’, ’cubic’, ’spline’,  
                               ’nearestflag’, ’linearflag’, ’cubicflag’, ’splineflag’,  
 
       spwmap -- Spectral windows combinations to form for gaintable(s)  
               default: [] (apply solutions from each spw to that spw only)  
               Example:  spwmap=[0,0,1,1] means apply the caltable solutions  
                         from spw = 0 to the spw 0,1 and spw 1 to spw 2,3.  
                         spwmap=[[0,0,1,1],[0,1,0,1]]  (for multiple gaintables)  
 
          Complicated example:  
 
            gaintable=[’tab1’,’tab2’,’tab3’]  
            gainfield=’3C286’  
            interp=[’linear’,’nearest’]  
            spwmap=[[],[0,0,2]]  
 
            This means: apply 3 cal tables, selecting only solutions for 3C286  
            from tab1 (but all fields from tab2 and tab3, indicated by  
            no gainfield entry for these files).  Linear interpolation  
            (in time) will be used for ’tab1’ and ’tab3’ (default); ’tab2’ will  
            use nearest.  For the ’tab2’, the calibration spws map  
            will be mapped to the data spws according to 0->0, 0->1, 2->2.  
            (I.e., for data spw=0 and 2, the spw mapping is one to one,  
            but data spw 1 will be calibrated by solutions from spw 0.)  
 
       parang -- If True, apply the parallactic angle correction.  FOR ANY  
               POLARIZATION CALIBRATION AND IMAGING, parang = True  
               default: False  
       calwt -- Calibrate weights along with data for each gaintable  
               default: True  (for all specified gaintables)  
               examples: calwt=False (for all specified gaintables)  
                         calwt=[True,False,True]  (specified per gaintable)  
       applymode -- Calibration apply mode:  
               ’’=’calflag’ (default) calibrate data and apply flags from solutions  
               ’trial’ report on flags from solutions, dataset entirely unchanged  
               ’flagonly’ apply flags from solutions only, data not calibrated  
               ’calonly’ calibrate data only, flags from solutions NOT  
                    applied (use with extreme caution!)  
               ’calflagstrict’ or ’flagonlystrict’ same as above  
                    except flag spws for which calibration is  
                    unavailable in one or more tables (instead of  
                    allowing them to pass uncalibrated and  
                    unflagged)  
 
       flagbackup -- Back up the state of the flags before applying calibration  
                     default: True  
       async -- Run task in a separate process  
                default: False; example: async=True  
 
 


More information about CASA may be found at the CASA web page

Copyright © 2016 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