|
User Documentation |
|||||||||
prev file | next file | ||||||||||
SUMMARY: fields | routine DETAILS: routine | ||||||||||
./guide getcal.pro
getcal |
procedure getcal, scan, [ifnum=integer], [intnum=integer], [plnum=integer], [fdnum=integer], [sampler=string], [/eqweight], [tcal=float], [sig_state=integer], [/quiet], [/keepints], [useflag=boolean or string], [skipflag=boolean or string], [instance=integer], [file=string], [timestamp=string], [status=variable] |
This procedure retrieves the "cal" signal from a cal-switched scan.
This code can be used as a template for the user who may wish to develop more tailored calibration schemes.
Summary
Parameters
The scan number is required. Arguments to identify the IF number, polarization number and feed number are optional. The procedure calculates Tsys based on the Tcal values and the data. The Tcal value comes from the mean_tcal value in cal_off phase data container unless the user supplies a value using the tcal keyword. In that case, one tcal value is supplied and that value is used for all integrations processed here. The two switching phases are differenced and a system temperature (Tsys) is calculated in the docal procedure. See the documentation for that procedure for details of the Tsys calculation.
If ifnum, fdnum, or plnum are not supplied then the lowest values for each of those where data exists (all combinations may not have data) will be used, using any user-supplied values. The value of ifnum is determined first, followed by fdnum and finally plnum. If a combination with data can not be found then showiftab is used to show the user what the set of valid combinations are. The summary line includes the ifnum, fdnum, and plnum used.
Weighting of Integrations in Scan Average
By default, the averaging of integrations is weighted using tsys, exposure, and frequency_resolution as described in the dcaccum documentation. To give all integrations equal weight instead of the default weighting based on Tsys, use the /eqweight keyword.
Using or Ignoring Flags
Flags (set via flag) can be selectively applied or ignored using the useflag and skipflag keywords. Only one of those two keywords can be used at a time (it is an error to use both at the same time). Both can be either a boolean (/useflag or /skipflag) or an array of strings. The default is /useflag, meaning that all flag rules that have been previously set are applied when the data is fetched from disk, blanking data as described by each rule. If /skipflag is set, then all of the flag rules associated with this data are ignored and no data will be blanked when fetched from disk (it may still contain blanked values if the actual values in the disk file have already been blanked by some other process). If useflag is a string or array of strings, then only those flag rules having the same idstring value are used to blank the data. If skipflag is a string or array of strings, then all flag rules except those with the same idstring value are used to blank the data.
Dealing With Duplicate Scan Numbers
There are 3 ways to attempt to resolve ambiguities when the same scan number appears in the data source. The instance keyword refers to the element of the returned array of scan_info structures that scan_info returns. So, if scan 23 appears 3 times then instance=1 refers to the second time that scan 23 appears as returned by scan_info. The file keyword is useful if a scan is unique to a specific file and multiple files have been accessed using dirin. If file is specified and instance is also specified, then instance refers to the instance of that scan just within that file (which may be different from its instance within all opened files when dirin is used). The timestamp keyword is another way to resolve ambiguous scan numbers. The timestamp here is a string used essentially as a label by the monitor and control system and is unique to each scan. The format of the timestamp string is "YYYY_MM_DD_HH:MM:SS". When timstamp is given, scan and instance are ignored. If more than one match is found, an error is printed and this procedure will not continue.
Parameters | |
scan |
M&C scan number |