|
Developer Documentation |
|||||||||
prev file | next file | ||||||||||
SUMMARY: fields | routine DETAILS: routine | ||||||||||
./guide check_calib_args.pro
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.
getIftabIndices | private |
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.