StepScanMapPol

class sofia_redux.instruments.hawc.steps.stepscanmappol.StepScanMapPol[source]

Bases: StepMOParent

Reconstruct an image from scanning polarimetry data.

This step requires that scanning polarimetry data are taken with four HWP angles, one per input file. Sets of data are identified by the SCRIPTID keyword, and are passed to the scan map algorithm one group at a time. R0 and T0 output maps are created for each input file to. This step assembles them into a single file with R0 and T0 extensions (DATA, ERROR, and EXPOSURE) for each HWP angle. One output file is produced for each set of 4 HWP angles.

Methods Summary

assemble_scanpol(dataout, basehead)

Assemble scan maps into a single file.

run()

Run the data reduction algorithm.

setup()

Set parameters and metadata for the pipeline step.

Methods Documentation

assemble_scanpol(dataout, basehead)[source]

Assemble scan maps into a single file.

HWP angles are determined from the HWPINIT key in the output file headers. If 4 unique angles with two subarray images each are not found, an error is raised.

Parameters:
dataoutlist of DataFits

Output scan maps to assemble.

baseheadfits.Header

Baseline header to update for output file.

Returns:
DataFits

The assembled data file.

Raises:
ValueError

If output is missing keywords HWPINIT, SUBARRAY, or TELVPA, or if 4 unique HWP angles are not found, or if the wrong number of subarray images are found (should be one R and one T).

run()[source]

Run the data reduction algorithm.

This step is run as a multi-in multi-out (MIMO) step: self.datain should be a list of DataFits, and output will also be a list of DataFits, stored in self.dataout.

The process is:

  1. Group input data by the header keyword SCRIPTID.

  2. Assemble the scan map options from input parameters.

  3. Call the iterative scan map reconstructor. Internally, the process will run multiple times, with appropriate arguments for each HWP angle. It will create multiple output maps: one for each of the R0 and T0 subarrays at each HWP angle. For the standard four-angle case, 8 maps are created.

  4. Assemble the output maps into a single output file per group, with a separate extension for flux, error, and exposure at each HWP angle and subarray.

  5. Merge header keywords from the input FITS files to generate an appropriate output header for each output file.

setup()[source]

Set parameters and metadata for the pipeline step.

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

Parameters defined for this step are:

vpa_tolfloat

If differences between telescope angles (VPA) are more than this value, this step will issue a warning.

use_framesstr

Frames to use from the reduction. Specify a particular range, as ‘400:-400’, or ‘400:1000’.

gridfloat

Output pixel scale. If not set, default values from scan map configuration will be used.

deepbool

If set, faint point-like emission is prioritized.

faintbool

If set, faint emission (point-like or extended) is prioritized.

extendedbool

If set, extended emission is prioritized. This may increase noise on large angular scales.

optionsstr

Additional options to pass to the scan map algorithm.