BaseMap

class sofia_redux.instruments.hawc.steps.basemap.BaseMap[source]

Bases: object

Mapping utilities for pipeline steps.

This class is designed to be used as mix-in for any pipeline step class that requires mapping functionality. It is assumed that the pipeline step will handle data input and output, as well as appropriate parameters.

Methods Summary

addgap(data, x, y)

Adjust x and y pixel coordinates for the gap between subarrays.

checkvalid()

Check data consistency.

getarg(parname)

Get input parameter.

make_resample_map(cdelt)

Construct map parameters from input data.

read_resample_data(maxgoodpix)

Read data from input images.

sumexptime()

Sum exposure time over input data.

Methods Documentation

addgap(data, x, y)[source]

Adjust x and y pixel coordinates for the gap between subarrays.

Header keywords ALNGAPX, ALNGAPY, and ALNROTA are used to determine the gap parameters. The x and y arrays are updated in place.

Parameters:
dataDataFits

Input data to adjust

xarray-like

X coordinates for the input image. Must be 2-dimensional (nrow x ncol).

yarray-like

Y coordinates for the input image. Must be 2-dimensional (nrow x ncol).

checkvalid()[source]

Check data consistency.

All input data are checked to make sure that SPECTEL1 and the number of HWP angles are the same across all input files. The number of HWP angles found is set as self.nhwp.

getarg(parname)[source]

Get input parameter.

This should be implemented by the pipeline step.

make_resample_map(cdelt)[source]

Construct map parameters from input data.

The coordinate grid for the map is determined from the range of the RA and Dec coordinates in the input data. The grid and associated reference values are stored in self.pmap, for use by the resampling algorithm. A draft header containing appropriate WCS information for the output map is stored in self.allhead.

The ‘proj’ parameter is used to set the projection type in the output header. The ‘sizelimit’ argument is tested against, to determine if the output map is too large. This error case is most likely due to inappropriately grouped input files. These parameters must be defined by the pipeline step inheriting from this class.

Parameters:
cdeltfloat

The pixel scale for the output map, in arcsec.

read_resample_data(maxgoodpix)[source]

Read data from input images.

This function ingests the data from self.datain, storing in the self.pdata list of dictionaries. Keys for each data dictionary are as follows; values are flattened arrays corresponding to good pixels only.

  • mask: bad pixel mask values

  • ra: RA coordinates

  • dec: Dec coordinates

  • I: Stokes I flux values

  • dI: Stokes I error values

The following additional keys are present only if self.nhwp > 1:
  • Q: Stokes Q flux values

  • dQ: Stokes Q error values

  • U: Stokes U flux values

  • dU: Stokes U error values

  • QIcov: Q-I covariance values

  • UIcov: U-I covariance values

  • QUcov: Q-U covariance values

Parameters:
maxgoodpixint

The maximum mask value to be considered good. If maxgoodpix=0, only good pixels present in both R and T arrays are used for stokes I. If maxgoodpix=2, widow pixels are also used for stokes I.

sumexptime()[source]

Sum exposure time over input data.

The EXPTIME keyword in self.dataout is set to the summed value as the total exposure time on-source.