separate_target_and_background

jwst.extract_1d.ifu.separate_target_and_background(ref)[source]

Create masks for target and background.

Parameters:
refndarray

This is the reference image data array (2D or 3D). This should be the same shape as one plane of the science data (or the same shape as the entire 3D science data array). A value of 1 in a pixel indicates that the pixel should be included when computing the target spectrum. A value of 0 means the pixel is not part of either the target or background. A value of -1 means the pixel should be included as part of the background region.

Returns:
mask_targetndarray

This is an array of the same type and shape as the reference image (2D or 3D), but with values of only 0 or 1. A value of 1 indicates that the corresponding pixel of the science data array should be included when adding up values to make the 1D spectrum, and a value of 0 means that it should not be included.

mask_bkgndarray or None

This is like mask_target (i.e., values are 0 or 1) but for background regions (2D or 3D). A value of -1 indicates a pixel that should be included as part of the background. If there is no pixel in the reference image with a value of -1, this will be set to None.