### FIXSTEPS

Fix DC steps in a supplied SCUBA-2 time series NDF

#### Description:

This routine runs the DC step fixer on a supplied time series (see parameter IN), and optionally writes the corrected data to an output time series (see parameter OUT). It is primarily intended as a debugging tool for the step fixing code. A description of the step fixes performed can be written to a text file (see parameter NEWSTEPS). This can then be supplied as input to a later run of this application in order to check that the new results are the same as the old results (see parameter OLDSTEPS). A warning message will be displayed if any significant difference is found between the old step fixes and the new step fixes.

Configuration parameters for the step fixing algorithm can be supplied either within a " makemap" -style configuration file (see parameter CONFIG), or via command line environment parameters DCFITBOX, DCSMOOTH, etc.

#### Parameters:

##### CHANGED = _LOGICAL (Write)
An output parameter to which is written a flag indicating if any significant differences were found between the step fixes produced by the current invocation of this program, and the step fixes described in the file specified via parameter OLDSTEPS.
Specifies default values for the configuration parameters used by the step fixing algorithm. This should be a configuration such as supplied for the MAKEMAP command. [!]
This parameter is prompted for after each changed step is described. If TRUE is supplied, then the program continues to display details of further changed steps. If FALSE is supplied, the program aborts.
##### DCFITBOX = _REAL
Number of samples (box size) in which the signal RMS is measured for the DC step finder. The run time default value is obtained via the CONFIG parameter. [!]
##### DCLIMCORR = _INTEGER
The detection threshold for steps that occur at the same time in many bolometers. Set it to zero to suppress checks for correlated steps. If dclimcorr is greater than zero, and a step is found at the same time in more than " dclimcorr" bolometers, then all bolometers are assumed to have a step at that time, and the step is fixed no matter how small it is. The run time default value is obtained via the CONFIG parameter. [!]
##### DCMAXSTEPS = _INTEGER
The maximum number of steps that can be corrected in each minute of good data (i.e. per 12000 samples) from a bolometer before the entire bolometer is flagged as bad. A value of zero will cause a bolometer to be rejected if any steps are found in the bolometer data stream. The run time default value is obtained via the CONFIG parameter. [!]
##### DCSMOOTH = _INTEGER
The width of the median filter used to smooth a bolometer data stream prior to finding DC jumps. The run time default value is obtained via the CONFIG parameter. [!]
##### DCTHRESH = _REAL
Threshold S/N to detect and flag DC (baseline) steps. The run time default value is obtained via the CONFIG parameter. [!]
##### FIRST = _INTEGER
The index of the first change to be display (the first change has index 1). Each change report starts with an index followed by a colon. [1]
The time series cube to be fixed. Note, the data must be time ordered (like the original raw data), not bolometer ordered.
Name of a text file to create, holding a description of each step that was fixed by the step fixing algorithm. The created file can be re-used in a later run via the OLDSTEPS parameter. It can also be viewed using " topcat -f ascii" . If a null (!) value is supplied for NEWSTEPS, no file is created. [!]