read_flat_file
- jwst.clean_flicker_noise.clean_flicker_noise.read_flat_file(input_model, flat_filename)[source]
Read flat data from an input file path.
Flat data is assumed to be full frame. Subarrays matching the input data are extracted as needed.
Only the flat image is returned: error and DQ arrays are ignored. Any zeros or NaNs in the flat image are set to a smoothed local average value (via
background_level, withbackground_method = 'model') before returning, to avoid impacting the background and noise fits near missing flat data.- Parameters:
- input_model
JwstDataModel The input data.
- flat_filenamestr
File path for a full-frame flat image.
- input_model
- Returns:
- flat_datandarray of float
A 2D flat image array matching the input data.