rectify

sofia_redux.spectroscopy.rectify.rectify(image, ordermask, wavecal, spatcal, header=None, variance=None, mask=None, bitmask=None, orders=None, x=None, y=None, dw=None, ds=None, badfrac=0.1, ybuffer=3, xbuffer=None, poly_order=3)[source]

Construct average spatial profiles over multiple orders

A simple wrapper for sofia_redux.spectroscopy.rectifyorder. Performs minimal argument checks on arguments relating to orders. The rest of the checks are performed by sofia_redux.spectroscopy.rectifyorder.

Parameters:
imagenumpy.ndarray of float (nrow, ncol)

2-d image

ordermasknumpy.ndarray of int (nrow, ncol)

order number of each pixel

wavecalnumpy.ndarray of float (nrow, ncol)

wavelength of each pixel

spatcalnumpy.ndarray of float (nrow, ncol)

Spatial coordinates of each pixel

headerfits.Header

Header to update with spectral WCS.

variancenumpy.ndarray of float (nrow, ncol), optional

Variance to rectify parallel to the image.

masknumpy.ndarray or bool (nrow, ncol), optional

Indicates good (True) and bad (False) pixels.

bitmasknumpy.ndarray of int (nrow, ncol), optional

bit-set mask

ordersarray_like of int, optional

(norders,) array orders to process. All are processed by default.

xnumpy.array, optional

(nrow, ncol) x-coordinates

ynumpy.array, optional

(nrow, ncol) y-coordinates

dwfloat, optional

Delta lambda based on the span of the order in pixels and wavelengths.

dsfloat, optional

The spatial sampling of the resampling slit in arcseconds, typically given by slth_arc / slth_pix.

xbufferint, optional

The number of pixels to ignore near the left and right of the slit.

ybufferint, optional

The number of pixels to ignore near the top and bottom of the slit.

badfracfloat, optional

If defines the maximum area of a pixel to be missing before that pixel should be considered bad. For example, a badfrac of 0.1 means that output flux of a pixel must be the sum of at least 0.9 input pixels.

poly_orderint, optional

Polynomial order to use when converting wavecal and spatcal to rectified values.

Returns:
dict
order (int) -> dict

image -> numpy.ndarray (ns, nw) wave -> numpy.ndarray (nw,) spatial -> numpy.ndarray (ns,) mask -> numpy.ndarray (ns, nw) bitmask -> numpy.ndarray (ns, nw) pixsum -> numpy.ndarray (ns, nw) variance -> numpy.ndarray (ns, nw) header -> fits.Header