StepNodPolSub

class sofia_redux.instruments.hawc.steps.stepnodpolsub.StepNodPolSub[source]

Bases: StepParent

Subtract low nods from high nods.

This step identifies low nods in the input data, and subtracts them from the high nods. The data must have been taken in either an ABBA pattern, or else must consist entirely of A nods (no nodding occurred). Error images for all nods are propagated appropriately.

For diagnostic purposes, the R and T data are also added across all nod positions, and stored as a ‘CMSIG’ extension.

The input for this step is assumed to be generated by sofia_redux.instruments.hawc.steps.StepCombine. The output is a DataFits with several image and table extensions. Seven image extensions for each HWP angle M are created: DATA R-T HWP M, ERROR R-T HWP M, DATA R+T HWP M, ERROR R+T HWP M, VAR R HWP M, VAR T HWP M, and CMSIG R+T HWP M. Also, a table, TABLE HWP M is created. Lastly, BAD PIXEL MASK is copied from the input into the output file.

Notes

For ABBA data, the output images (\(d'\)) and associated errors (\(\sigma'\)) are calculated as:

\[d' = \frac{1}{2}(d_A - d_B)\]
\[\sigma' = \frac{1}{2}\sqrt{\sigma_A^2 + \sigma_B^2}\]

The variances in R and T are also propagated as:

\[\sigma_R'^2 = \sigma_{R,A}'^2 + \sigma_{R,B}'^2\]
\[\sigma_T'^2 = \sigma_{T,A}'^2 + \sigma_{T,B}'^2\]

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. For each HWP angle, subtract the B nod from the A nod, and divide by two (assuming a nod-match-chop pattern); propagate errors accordingly.

  2. Store the data in a DataFits object.

setup()[source]

Set parameters and metadata for the pipeline step.

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

No parameters are currently defined for this step.