StepCombine¶
- class sofia_redux.instruments.hawc.steps.stepcombine.StepCombine[source]¶
Bases:
StepParent
Combine time series data for R+T and R-T flux samples.
This step averages all chop-subtracted samples for each nod and HWP setting, for the R+T and R-T images. Outliers are identified via iterative sigma-clipping (Chauvenet’s criterion). Errors are propagated from the input variance images or, optionally, reported as the standard deviation across the time samples.
After this step, R-T images are propagated for polarimetry data only (NHWP > 1).
This step should be run after the
sofia_redux.instruments.hawc.steps.StepSplit
pipeline step. It requires the following extensions: for each HWP angle M and Nod N there should be six images: DATA R-T HWP M NOD N, DATA R+T HWP M NOD N, VAR R-T HWP M, NOD N, VAR R+T HWP M NOD N, VAR R HWP M NOD N, VAR T HWP M NOD N. In addition, there must be a table containing the rows corresponding to a given HWP and Nod, named TABLE HWP M NOD N. Finally, there should be a single bad pixel mask image.The output extensions are the same as the input extensions, except that VAR R+T and VAR R-T are replaced with ERROR R+T and ERROR R-T extensions.
Methods Summary
comb_table
(table, newmask)Average all rows for a table.
run
()Run the data reduction algorithm.
setup
()Set parameters and metadata for the pipeline step.
Methods Documentation
- comb_table(table, newmask)[source]¶
Average all rows for a table.
- Parameters:
- tablefits.FITS_rec
The table to average.
- newmaskarray-like of bool
Table rows to combine.
- Returns:
- BinTableHDU
The averaged table.
- 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.
This step combines the chop cycles for each HWP angle and Nod separately (and each pixel as well). This happens first for the R-T data, as follows:
For each pixel in R-T, compute the mean value and standard deviation.
Reject any chop cycles more than sigma away from the mean.
Repeat 1-2 until no more chop cycles are removed.
Any masked pixels from R-T deglitching are also masked in R+T. Additional deglitching in R+T follows the same outlier rejection as for R-T, with the sigma cutoff specified by the sum_sigma parameter.
- setup()[source]¶
Set parameters and metadata for the pipeline step.
Output files have PRODTYPE = ‘combine’, and are named with the step abbreviation ‘CMB’.
Parameters defined for this step are:
- sigmafloat
Reject outliers more than this many sigma from the mean.
- sum_sigmafloat
Reject additional R+T outliers more than this many sigma from the mean.
- use_errorbool
Set to True to use the standard deviation across the time samples as the output error, rather than propagating input variances.