### SC2FFT

Fourier Transform SCUBA-2 time-series data

#### Description:

This routine performs the forward or inverse FFT of SCUBA-2 time-series data. The FFT of the data are stored in a 4-dimensional array with dimensions frequency, xbolo, ybolo, component (where component is a dimension of length 2 holding the real and imaginary parts). The inverse flag is used to transform back to the time domain from the frequency domain. If the data are already in the requested domain, the ouput file is simply a copy of the input file.

#### Parameters:

Calculate average power spectral density over " good" bolometers. By default a 1/noise^2 weight is applued (see WEIGHTAVPSPEC). [FALSE]
N-sigma noise threshold to define " good" bolometers for AVPSPEC [5]
Group of files to be used as bad bolometer masks. Each data file specified with the IN parameter will be masked. The corresponding previous mask for a subarray will be used. If there is no previous mask the closest following will be used. It is not an error for no mask to match. A NULL parameter indicates no mask files to be supplied. [!]
If set ensure data are flatfielded. If not set do not scale the data in any way (but convert to DOUBLE). [TRUE]
Method to use to calculate the flatfield solution. Options are POLYNOMIAL and TABLE. Polynomial fits a polynomial to the measured signal. Table uses an interpolation scheme between the measurements to determine the power. [POLYNOMIAL]
The order of polynomial to use when choosing POLYNOMIAL method. [1]
Signal-to-noise ratio threshold to use when filtering the responsivity data to determine valid bolometers for the flatfield. [3.0]
If true the previous and following flatfield will be used to determine the overall flatfield to apply to a sequence. If false only the previous flatfield will be used. A null default will use both flatfields for data when we did not heater track at the end, and will use a single flatfield when we did heater track. The parameter value is not sticky and will revert to the default unless explicitly over-ridden. [!]
Input files to be transformed.
Perform inverse transform. [FALSE]
Control the verbosity of the application. Values can be NONE (no messages), QUIET (minimal messages), NORMAL, VERBOSE, DEBUG or ALL. [NORMAL]
##### NGOOD = _INTEGER (Write)
Number of good bolometers which contribute to average power spectrum.
##### OUT = NDF (Write)
Output files. The number of output files can differ from the number of input files due to darks being filtered out and also to files from the same sequence being concatenated before aplying the FFT.
##### OUTFILES = LITERAL (Write)
The name of text file to create, in which to put the names of all the output NDFs created by this application (one per line). If a null (!) value is supplied no file is created. [!]
Use polar representation (amplitude, argument) of FFT. [FALSE]
Use polar representation of FFT with squared amplitudes divided by the frequency bin spacing (gives a power spectral density, PSD). [FALSE]
A group expression containing the resistor settings for each bolometer. Usually specified as a text file using " ^" syntax. An example can be found in $STARLINK_DIR/share/smurf/resist.cfg [$STARLINK_DIR/share/smurf/resist.cfg]
If set, weight power spectrum of each bolo by 1/noise^2 when calculating the average (estimated from 2–20 Hz spectrum). [TRUE]