StepWcs

class sofia_redux.instruments.hawc.steps.stepwcs.StepWcs[source]

Bases: StepParent

Add world coordinate system definitions.

This pipeline step will add WCS keywords to the header, accounting for vertical position angle (VPA) and position offsets. The reference position is taken to be the boresight pixel position (SIBS_X, SIBS_Y) with RA and Dec coordinates taken from TELRA and TELDEC.

The following header keywords are set by this step:

  • TEL_AZ : telescope azimuth

  • TEL_ELEV : telescope elevation

  • VPOS_ANG : array VPA

  • CROTA2 : image rotation, relative to North (set from -1 * VPA)

  • CRVAL1 : boresight RA (set from TELRA)

  • CRVAL2 : boresight Dec (set from TELDEC)

  • CRPIX1 : boresight x position (set from SIBS_X)

  • CRPIX2 : boresight y position (set from SIBS_Y)

  • CDELT1 : pixel scale (set from PIXSCAL)

  • CDELT2 : pixel scale (set from PIXSCAL)

  • CTYPE1 : WCS projection (set to ‘RA—TAN’)

  • CTYPE2 : WCS projection (set to ‘DEC–TAN’)

Input for this step is a DataFits containing Stokes images and associated errors, as produced by sofia_redux.instruments.hawc.steps.StepStokes.

Output is the same as the input file, with the above header keywords set in the primary header.

Methods Summary

compute_wcs()

Compute WCS parameters from telescope data.

read_sibs()

Read an offset value from the parameters.

run()

Run the data reduction algorithm.

setup()

Set parameters and metadata for the pipeline step.

Methods Documentation

compute_wcs()[source]

Compute WCS parameters from telescope data.

Corrects for chop offsets between SIBS and source position.

Returns:
crval1, crval2, crpix1, crpix2tuple of float

WCS reference position values.

read_sibs()[source]

Read an offset value from the parameters.

The parameters are expected to be defined as a list, with one entry for each HAWC band. The correct value for the input data is selected from the list.

Returns:
float

The SIBS offset value.

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. Compute the VPA from the ‘Array VPA’ data column. Add 180 degrees if necessary.

  2. Compute reference positions from SIBS boresight and chop offset information.

  3. Store header keywords.

setup()[source]

Set parameters and metadata for the pipeline step.

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

Parameters defined for this step are:

add180vpabool

If set, 180 degrees is added to the VPA derived from the ‘Array VPA’ data column, before setting VPOS_ANG.

offsibs_xlist of float

Offset in pixels to add to SIBS_X to correct for actual target position. One value for each HAWC waveband.

offsibs_ylist of float

Offset in pixels to add to SIBS_Y to correct for actual target position. One value for each HAWC waveband.

labmodebool

If set, telescope data will be ignored and placeholder astrometry values will be added to the header.