NRAO Home > CASA > CASA Cookbook and User Reference Manual

1.4.5 Setting Parameters and Invoking Tasks

Inside the Toolkit:
In the current version of CASA, you cannot use the task parameter setting features, such as the inp, default, or go commands, for the tools.

One can set parameters for tasks (but not for tools) by performing the assignment within the CASA shell and then inspecting them using the inp command:

CASA <30>: default(bandpass)  
CASA <31>: vis = ’ngc5921.demo.ms’  
CASA <32>: caltable = ’ngc5921.demo.bcal’  
CASA <33>: field = ’0’  
CASA <34>: refant = ’15’  
CASA <35>: inp(’bandpass’)  
#  bandpass :: Calculates a bandpass calibration solution  
vis         = ’ngc5921.demo.ms’ #  Nome of input visibility file  
caltable    = ’ngc5921.demo.bcal’ #  Name of output gain calibration table  
field       =        ’0’        #  Select field using field id(s) or field name(s)  
spw         =         ’’        #  Select spectral window/channels  
selectdata  =      False        #  Other data selection parameters  
solint      =      ’inf’        #  Solution interval  
combine     =     ’scan’        #  Data axes which to combine for solve (scan, spw, field)  
refant      =       ’15’        #  Reference antenna name  
minblperant =          4        #  Minimum baselines _per antenna_ required for solve  
solnorm     =      False        #  Normalize average solution amplitudes to 1.0 (G, T only)  
bandtype    =        ’B’        #  Type of bandpass solution (B or BPOLY)  
  fillgaps  =          0        #  Fill flagged solution channels by interpolation  
append      =      False        #  Append solutions to the (existing) table  
gaintable   =         ’’        #  Gain calibration table(s) to apply on the fly  
gainfield   =         ’’        #  Select a subset of calibrators from gaintable(s)  
interp      =         ’’        #  Interpolation mode (in time) to use for each gaintable  
spwmap      =         []        #  Spectral windows combinations to form for gaintables(s)  
gaincurve   =      False        #  Apply internal VLA antenna gain curve correction  
opacity     =        0.0        #  Opacity correction to apply (nepers)  
parang      =      False        #  Apply parallactic angle correction  
async       =      False        #

See § 1.4.5.4 below for more details on the use of the inputs command.

All task parameters have global scope within CASA: the parameter values are common to all tasks and also at the CASA command line. This allows the convenience of not changing parameters that are shared between tasks but does require care when chaining together sequences of task invocations (to ensure proper values are provided).

If you want to reset the input keywords for a single task, use the default command (§ 1.4.5.2). For example, to set the defaults for the bandpass task, type:

CASA <30>: default(’bandpass’)

as we did above.

To inspect a single parameter value just type it at the command line. Continuing the above example:

CASA <36>: combine  
  Out[14]: ’scan’

CASA parameters are just Python variables.

Parameters for a given task can be saved by using the saveinputs command (see § 1.4.5.5) and restored using the execfile ’<filename>’ command. Note that if the task is successfully executed, then a <taskname>.last file is created in the working directory containing the parameter values (see § 1.4.5.8).

We now describe the individual CASA task parameter interface commands and features in more detail.

   1.4.5.1 The scope of parameters in CASA
   1.4.5.2 The default Command
   1.4.5.3 The go Command
   1.4.5.4 The inp Command
   1.4.5.5 The saveinputs Command
   1.4.5.6 The tget Command
   1.4.5.7 The tput Command
   1.4.5.8 The .last file


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