apply_flags

jwst.badpix_selfcal.badpix_selfcal.apply_flags(input_model: IFUImageModel, flagged_indices: ndarray) IFUImageModel[source]

Apply the flagged indices to the input model.

Sets the flagged pixels to NaN and the DQ flag to DO_NOT_USE + OTHER_BAD_PIXEL.

Parameters:
input_modelIFUImageModel

Input science data to be corrected; updated in place.

flagged_indicesndarray

Indices of the flagged pixels, shaped like output from numpy.where().

Returns:
output_modelIFUImageModel

Flagged data model