make_mask

jwst.ipc.x_irs2.make_mask(input_model, n=None, r=None)[source]

Create a mask to extract ‘normal’ pixels.

This is used by from_irs2() and to_irs2().

Parameters:
input_modelJwstDataModel or ndarray

Either the input science data model or the data array from the input data model. This is used for getting the IRS2 parameters and the length of the longer image axis.

nint or None

If not None, this value will be used for the nrs_normal parameter. If n is None, the value will be obtained from the metadata for input_model; if this fails (e.g., if input_model is actually an ndarray), a default value of 16 will be used. None is the default.

rint or None

If not None, this value will be used for the nrs_reference parameter. See also the description for n. None is the default.

Returns:
irs2_maskndarray

Boolean index mask (1-D) with length equal to the last axis of the science data shape.