no_nan

jwst.persistence.persistence.no_nan(input_model, fill_value, zap_nan=False, zap_zero=False)[source]

Replace NaNs and/or zeros with a fill value.

Parameters:
input_modelJwstDataModel

The input will typically be a reference file model.

fill_valuefloat

Use this value to replace NaNs and/or zeros.

zap_nanbool

If True, replace NaNs in a copy of input_model.data. The default is False.

zap_zerobool

If True, replace zeros in a copy of input_model.data. The default is False.

Returns:
JwstDataModel

A copy of input_model with NaNs and/or zeros in the data attribute replaced with fill_value.