StepDmdCut

class sofia_redux.instruments.hawc.steps.stepdmdcut.StepDmdCut[source]

Bases: StepParent

Filter bad chops from demodulated data.

This step removes chop cycles from the demodulated data arrays, according to flags set by the demodulation algorithm.

The expected input is a demodulated file with a ‘Chop Mask’ column in the data table. Input is generated by the sofia_redux.instruments.hawc.steps.StepDemodulate pipeline step. The output is a table with the same columns as the input, but some rows removed.

The flag bits for the Chop Mask column are:

  • bit 0: incomplete chop

  • bit 1: check on azelstate

  • bit 2: HWP moving

  • bit 3: check on nodstate

  • bit 4: spare

  • bit 5: spare

  • bit 6: LOS rewind

  • bit 7: tracking errors too high

  • bit 8: CentroidExpMsec below threshhold

  • bit 9: extra samples before and after tracking tolerance violation

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.

This step is run as a single-in single-out (SISO) step: self.datain should be a DataFits object, and output will also be a single DataFits, stored in self.dataout.

The process is:

  1. Read the desired filter flags from the input parameters and compare with the Chop Mask column in the input.

  2. Remove flagged samples.

setup()[source]

Set parameters and metadata for the pipeline step.

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

Parameters defined for this step are:

mask_bitsint

Bits on which to filter the data. Set to 0b1111111111 (1023) to filter on all flags. Set to 0b001000000 (64) to filter on LOS rewind only. Set to 0 to skip all flags.

min_samplesint

Chops containing fewer than min_samples in the Samples column will be removed from the output.