to_irs2

jwst.ipc.x_irs2.to_irs2(irs2_data, norm_data, irs2_mask, detector=None)[source]

Copy ‘normal’ pixel data into an IRS2 image.

Parameters:
irs2_datandarray

Data in IRS2 format. This will be modified in-place.

norm_datandarray

The normal data, for example previously extracted from irs2_data but then modified in some way. This will be copied back into irs2_data in the correct locations, as specified by irs2_mask.

irs2_maskndarray

Boolean mask (1-D) identifying the locations of the “normal” pixels within irs2_data. The length is 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, detector 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, detector should be None (the default), and the mask will be applied to the columns.