Produced by IDL 7.1.1
User Documentation

./toolbox
dofreqswitch.pro

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

dofreqswitch

procedure dofreqswitch, sigwcal, sig, refwcal, ref[, smoothref], [tsys=float], [tau=float], tcal=tcal, sigResult=variable, [refResult=variable]

This procedure calibrates a single integration from a frequency switched scan.

The expected 4 spectra that are used here are the signal with no cal, the signal with cal, the reference with no cal and the reference with cal.

dcfold can then be used to combine sigresult and refresult to produce a folded result. That step does not happen here.

The user can optionally over-ride the reference system temperature calculated in dototalpower and used in dosigref by supplying a value for the tsys and tau keywords here. tsys is the system temperate at tau=0. If the user supplies this keyword, tsys is first adjusted to the elevation of the reference spectrum :

 tsys_used = tsys*exp(tau/sin(elevation).  
 
If tau is not supplied, then the get_tau function is used, using the reference observed_frequency to arrive at a very rough guess as to the zenith opacity, tau. Users are encouraged to supply tau when they also supply tsys to improve the accuracy of this calculation. The adjusted tsys then becomes the reference spectrum's tsys value for use in dosigref.

The units of sigresult and refresult are "Ta". Use dcsetunits to change these units to something else.

This is used primarily by getfs and this code does almost no argument checks or sanity checks. The calling routine is expected to check that the 4 input spectra are compatible (all are valid data containers and all have the same number of data points).

It is the responsibility of the caller to ensure that sigResult and refResult are freed using data_free when their use is finished (i.e. at the end of all anticipated calls to this function before returning to the calling level). Failure to do that will result in memory leaks. It is not necessary to free these data containers between consecutive calls to this function at the same IDL level (e.g. inside the same procedure).

Version
$Id$

Parameters
sigwcal
in, required
spectrum
An uncalibrated spectrum from the signal phase with the cal on.
sig
in, required
spectrum
An uncalibrated spectrum from the signal phase with the cal off.
refwcal
in, required
spectrum
An uncalibrated spectrum from the reference phase with the cal on.
ref
.
smoothref
in, optional
integer
Boxcar smooth width for reference spectrum. No smoothing if not supplied or if value is less than or equal to 1.

Keywords
tsys
in, optional
float
tsys at zenith, this is converted to a tsys at the observed elevation. If not suppled, the tsys for each integration is calculated as described elsewhere.
tau
in, optional
float
tau at zenith, if not supplied, it is estimated using get_tau tau is only used when the requested units are other than the default of Ta and when a user-supplied tsys value at zenith is to be used.
tcal
.
sigResult
out, required
variable
The result when using the signal phases as "sig" in dosigref.
refResult
out, optional
variable
This result when using the reference phases as "sig" in dosigref.


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