Produced by IDL 7.1.1
User Documentation

./guide
fold.pro

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

fold

procedure fold[, sig][, ref], [ftol=double], [/blankinterp], [/nomask]

Average two parts of in-band frequency switching (signal and reference phases, with the cal-switching phases already calibrated).

Typically this happens during or after getfs. The two data containers are assumed to be in 0 and 1. It does not matter which data container contains which part since their relative distance in frequency is used to determine how one is shifted to align with the other. The result is always placed in data container 0. If the two data containers do not overlap in frequency, then there is nothing to fold and an error message will be printed.

The "ref" data container is shifted to align in sky frequency with the "sig" data container using dcshift and the two data containers are averaged - weighting each by the inverse of square of their system temperatures. The system temperature in the result is the weighted average of the two system temperatures.

If there are any blanked channels in either "sig" or "ref" then the corresponding channels in the other spectrum, after "ref" has been shifted to align in sky frequency with "sig", are also blanked so that the average at those channels is blanked. This is done to avoid the appearance of a spike at a blanked channel where the contribution from the other spectrum, after the shift, is typically not blanked and not equal to the local average of surrounding, non-blanked, channels. This behavior can be turned off by the nomask keyword. Alternatively, all blanked channels in "sig" and "ref" can be replaced using a linear interpolation from adjacent non-blanked channels (a simple average in the case of single, isolated, blanked channels) using the blankinterp keyword.

Examples
    getfs, 64, /nofold
    fold, ftol=1.0       ; no fractional shifting is done
 
Uses
dcfold data_free set_data_container
Version
$Id$

Parameters
sig
in, optional
integer (def. 0)
The global buffer number to use as the signal part in the average. The result will contain a copy of this data container's header information except for tsys as described above. The data at sig is overwritten by the result if sig is 0 (the default)
ref
in, optional
integer (def. 1)
The global buffer number to use as the reference part in the average. This data is shifted using dcshift to align with "sig" before averaging. The data in ref are never altered by this procedure.

Keywords
ftol
in, optional
double (def. 0.005)
The fractional channel shift tolerance. If the fractional part of the channel shift necessary to align the two parts is less than this value, no fractional shift as described in the documentation for dcshift will be done. It might be useful to turn off the fractional shift because it can cause aliases and ringing in the case of very strong lines or other sharp features. If ftol > 0.5 no fractional shifts will be done.
blankinterp
in, optional
boolean
When set, blanks are replaced before shifting and averaging by a linear interpolation using the finite values found in the two spectra. The dcinterp procedure is used. For isolated blanked channels, the replacement value is the average of the two adjacent channel values.
nomask
in, optional
boolean
When set, turn off the masking of blank channels from each spectrum on to the other, after the shift. This may result in spikes at the location of blanked channels. This was the original behavior of thsi routine. This keyword has no effect if blankinterp is set.


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