StepShift

class sofia_redux.instruments.hawc.steps.stepshift.StepShift[source]

Bases: StepParent

Align the R and T arrays.

This step performs various array manipulations to trim and align the detector subarrays. First, the last row is removed, since it is unilluminated. Then, the R1 and T1 subarrays are rotated to align with R0 and T0, and all subarrays are flipped over the y-axis. The first and last chops in the demodulated data are removed. Finally, the R array is shifted to align with the T array.

Only linear pixel shifts between R and T are performed here. Any additional misalignment (e.g. rotation) is handled in later mapping steps. The parameters passed here are set as header keywords, to be applied as needed by sofia_redux.instruments.hawc.steps.StepMerge.

This step will also check for the TRCKSTAT keyword in the FITS header. If it has been set to BAD, this step will issue an error and halt processing.

Input for this step is a flat-fielded file, where the R Array, T Array, and their variances are now images instead of columns in the data table. This step is typically run after sofia_redux.instruments.hawc.steps.StepFlat.

Output from this step is the same as the input file, except that the R and T images, variances, and masks have been trimmed and shifted. Additionally, some unneeded columns are removed from the DEMODULATED DATA table, and header keywords are set to describe R and T relative geometry. These keywords are ALNANG1, ALNANG2, ALNMAGX, ALNMAGY, ALNGAPX, ALNGAPY, and ALNROTA.

Methods Summary

run()

Run the data reduction algorithm.

setup()

Set parameters and metadata for the pipeline step.

Methods Documentation

run()[source]

Run the data reduction algorithm.

Because this step is single-in, single-out (SISO), self.datain must be a DataFits object. The output is also a DataFits object, stored in self.dataout.

The process is:

  1. Check for tracking status problems.

  2. Remove unneeded data table columns.

  3. Rotate, flip, and trim data arrays.

  4. Store alignment keywords.

  5. Shift the R array to match the T array.

Raises:
ValueError

If TRCKSTAT is BAD.

setup()[source]

Set parameters and metadata for the pipeline step.

Output files have PRODTYPE = ‘shift’, and are named with the step abbreviation ‘SFT’.

Parameters defined for this step are:

angle1float

Rotation angle of R0 relative to T0, in degrees counter-clockwise, to be stored in keyword ALNANG1.

angle2float

Rotation angle of R1 relative to T1, in degrees counterclockwise, to be stored in keyword ALNANG2.

maglist of float

Magnification of R relative to T, in the x, y pixel direction, given as [mx, my]. This will be stored in keywords ALNMAGX, ALNMAGY.

disp1list of float

Pixel displacement of R0 relative to T0, in the x, y directions, given as [dx, dy]. This will be applied to the data with a linearly interpolated shift.

disp2list of float

Pixel displacement of R1 relative to T1, in the x, y directions, given as [dx, dy]. This will be applied to the data with a linearly interpolated shift.

gapxfloat

Displacement in x pixels between T0 and T1. This will be stored in keyword ALNGAPX.

gapyfloat

Displacement in y pixels between T0 and T1. This will be stored in keyword ALNGAPY.

gapanglefloat

Rotation angle in degrees counter-clockwise between T0 and T1. This will be stored in keyword ALNROTA.