from_irs2

jwst.saturation.x_irs2.from_irs2(irs2_data, irs2_mask, detector=None)[source]

Extract ‘normal’ pixel data from an IRS2 image.

Parameters:
irs2_datandarray

Data in IRS2 format. This can be a slice in the Y direction, but it should include the entire X (last) axis.

irs2_maskndarray

Boolean mask (1-D) to extract the “normal” pixels. This is a 1-D array with length equal to the size of the next-to-last axis (for data in DMS orientation) of irs2_data.

detectorstr or None

For IRS2 data in DMS orientation, this should be either “NRS1” or “NRS2”; NIRSpec is currently the only instrument supported in this module. The mask will be applied to the rows, and for “NRS2” the mask will first be reversed. For IRS2 data in detector orientation, this should be None (the default), and the mask will be applied to the columns.

Returns:
norm_datandarray

The normal pixel data (i.e., without embedded reference pixels).