flag_bad_refpix

jwst.refpix.irs2_subtract_reference.flag_bad_refpix(datamodel, n_sigma=3.0, flag_only=False, replace_only=False)[source]

Flag bad reference pixels and replace with nearest good values.

Parameters:
datamodelJwstDataModel

The data, in science orientation. This includes both the science and interleaved reference pixel values. Data and pixeldq will be modified in-place. The science data values will not be modified.

n_sigmafloat, optional

Flagging threshold, expressed as a factor times the standard deviation.

flag_onlybool, optional

If set, bad values will be flagged in the pixeldq extension but not replaced.

replace_onlybool, optional

If set, previously flagged bad values will be replaced, but new outliers will not be flagged.