Produced by IDL 7.1.1
Developer Documentation

./guide
check_calib_args.pro

Last modification date:
Wed Sep 28 13:27:12 2016

Routine Summary  2 routines

function check_calib_args([scan][, refscan], [intnum=integer], [ifnum=integer], [plnum=integer], [fdnum=integer], [sampler=string], [/eqweight], [units=string], [bswitch=integer], [/quiet], [/keepints], [/useflag], [/skipflag], [instance=integer], [file=string], [timestamp=string], [refinstance=integer], [reffile=string], [reftimestamp=string], [/checkref], [tau=float], [ap_eff=float], [/twofeeds], [sig_state=integer], ret=variable, info=variable)

This function is used by the standard calibration routines to handle some argument checking and to assign default values to keywords when not provided by the user.

function getIftabIndices(loc, nif, nfd, npl)

private

Private function to return the array indices in a 3D iftable array given the array dimensions.

Routine Details

check_calib_args

function check_calib_args([scan][, refscan], [intnum=integer], [ifnum=integer], [plnum=integer], [fdnum=integer], [sampler=string], [/eqweight], [units=string], [bswitch=integer], [/quiet], [/keepints], [/useflag], [/skipflag], [instance=integer], [file=string], [timestamp=string], [refinstance=integer], [reffile=string], [reftimestamp=string], [/checkref], [tau=float], [ap_eff=float], [/twofeeds], [sig_state=integer], ret=variable, info=variable)

This function is used by the standard calibration routines to handle some argument checking and to assign default values to keywords when not provided by the user.

Encapsulating these here should make it easier for users to adapt a calibration routine to do what they want it to do.

Since the calibration routines all only work for line data, GBTIDL must currently be in line mode when this routine is called. If it is in continuum mode, that is an error and this function will return -1. In addition, there must already be line data opened using either filein or dirin.

The argument descriptions here refer to what this routine checks for, not what the argument means. For the meaning of a specific argument, see the calibration routine in question. Type checking is only done for string keywords.

Because this routine is designed to be called by another routine, errors are reported such that the message prefix is the name of the calling routine. Users are least likely to be confused by those messages.

A warning is printed if tau or ap_eff are specified and the units value (explicit or implied) means tau or ap_eff are not used (e.g. the default units 'Ta' do not need tau or ap_eff and so if they are provided, a warning to that effect is printd). This not considered a severe problem and processing continues. This can be turned off if the quiet keyword is set.

If there was a severe problem, the return value is 0 (false) and the calling routine should exit at that point. If the arguments are all okay then the return value is 1 and any defaults are returned in a structure in the defaults keyword value.

If sampler is supplied then all 3 of ifnum, plnum, and fdnum must not be supplied. The returned values for these 3 are all -1, implying that sampler should be used.

If ifnum, fdnum, or plnum are not supplied, the lowest valid value with data is chosen. This value is picked by first setting, ifnum, then fdnum, and finally plnum (using any user-supplied values first). If there is no valid data using the user-supplied values then showiftab is used to display the set of valid values and the return value is -1.

Version
$Id$

Parameters
scan
in, optional
integer
If scan is not supplied, then a valid timestamp keyword must be supplied. No default supplied.
refscan
in, optional
integer
Ignored unless checkref is true. If refscan is not supplied, then a valid reftimestamp keyword must be supplied. No default supplied.

Keywords
intnum
in, optional
integer
Must be >= 0.
ifnum
in, optional
integer
Must be >= 0. Defaults as described above.
plnum
in, optional
integer
Kust be >= 0. Defaults as described above.
fdnum
in, optional
integer
Must be >= 0. Defaults
sampler
in, optional
string
Must be non-empty. Defaults to '' (empty, unspecified). When set, the returned ifnum, plnum, and fdnum values are all -1.
eqweight
in, optional
boolean
.
units
in, optional
string
Must be one of "Ta","Ta*", or "Jy".
bswitch
in, optional
integer
Must be 0, 1 or 2. Defaults to 0.
quiet
in, optional
boolean
.
keepints
in, optional
boolean
.
useflag
in, optional
boolean
Only one of useflag and skipflag can be set.
skipflag
in, optional
boolean
Only one of useflag and skipflag can be set.
instance
in, optional
integer
Must be >= 0. Defaults to 0.
file
in, optional
string
.
timestamp
in, optional
string
If scan is not supplied, then a valid timestamp keyword must be supplied.
refinstance
in, optional
integer
Ignored unless checkref is true. Must be >= 0. Defaults to 0.
reffile
in, optional
string
Ignored unless checkref is true.
reftimestamp
in, optional
string
Ignored unelss checkref is true. If refscan is not supplied, then a valid reftimestamp keyword must be supplied.
checkref
in, optional
boolean
Check refscan and the ref* keywords?
tau
in, optional
float
Warning if tau is set and units is 'Ta' or unset.
ap_eff
in, optional
float
Warning if units is not 'Jy'.
twofeeds
in, optional
boolean
When set, fdnum is assumed to be a tracking feed number and it is not influenced by any value that sampler might have.
sig_state
in, optional
integer
Used for sig_state selection. When set it must be 0 or 1. Returned value is -1 if unset or out of bounds.
ret
out, required
variable
The values to use for ifnum, plnum, fdnum, instance, and bswitch taking into account the defaults as described here. This is done so that the values of the calling arguments are not altered by this function.
info
out, required
variable
The scan info structure associated with the scan, timestamp, instance and file arguments as given. This will not be a structure if there was a problem.

getIftabIndices private

function getIftabIndices(loc, nif, nfd, npl)

Private function to return the array indices in a 3D iftable array given the array dimensions. Used instead of array_indices because of the way IDL tosses out single-element arrays whenever possible, making it damn difficult to write general purpose code. This routine always returns 3 values. The length of the 3rd axis is not important here. There is no checking loc for validity (the only reason this might care about that value). IDL arrays are stored in fortran order.

Returns
(3,n_elements(loc)) array, one 3-D vector giving the coordinates into a 3D array described by nif, nfd, npl for each element of loc.

Parameters
loc
in, required
integer
Vector of locations into a 3D array described by the other parmeters.
nif
in, required
integer
Length of first axis.
nfd
in, required
integer
Length of second axis.
npl
.


Produced by IDLdoc 1.6 on Wed Sep 28 13:27:17 2016