subtract_reference

jwst.refpix.irs2_subtract_reference.subtract_reference(data0, alpha, beta, irs2_mask, scipix_n, refpix_r, pad, preserve_refpix=False)[source]

Subtract reference output and pixels for the current integration.

Parameters:
data0ndarray

The science data for the current integration. The shape is expected to be (ngroups, ny, 3200), where ngroups is the number of groups, and ny is the pixel height of the image. The width 3200 of the image includes the “normal” pixel data, plus the embedded reference pixels, and the reference output.

alphandarray

This is a 2-D array of values read from the reference file. The first axis is the sector number (but only for the normal pixel data and reference pixels, not the reference output). The second axis has length 2048 * 712, corresponding to the time-ordered arrangement of the data. For each sector, the correction is applied as follows:

data * alpha[i] + reference_output * beta[i]
betandarray

Data read from the reference file. See alpha for details.

irs2_maskndarray

A 1-D boolean array, where True means the element corresponds to a normal pixel in the raw, IRS2-format data; False corresponds either to a reference output pixel or to one of the interspersed reference pixel values.

scipix_nint

Number of regular samples before stepping out to collect reference samples.

refpix_rint

Number of reference samples before stepping back in to collect regular samples.

padint

The effective number of pixels sampled during the pause at the end of each row (new-row overhead).

preserve_refpixbool

If True, reference pixels will be preserved in the output. This is not used in the science pipeline, but is necessary to create new bias files for IRS2 mode.

Returns:
data0ndarray

The science data for the current integration, with reference output and embedded reference pixels subtracted and also removed, leaving only the normal pixel data (including the reference pixels on each edge). The shape is expected to be (ngroups, ny, nx), where nx = ny = 2048.