JWSTMiri_cal
- class breads.instruments.JWSTMiri_cal(filename=None, channel_reduction='1', utils_dir=None, save_utils=True, load_utils=True, preproc_task_list=None, verbose=True, wv_ref=None)[source]
Bases:
JWST_IFUsJWST MIRI/MRS 2D calibrated data class.
- Parameters:
- filename: str
Path to the calibrated FITS file.
- channel_reduction: str or int (default=’1’)
MIRI channel selected for reduction. (MIRI/MRS calibrated images always have two channels).
- utils_dir: str or None
Path to the folder saving the intermediate products of each preprocessing step.
- save_utils: bool (default=True)
Whether to save intermediate products.
- load_utils: bool (default=True)
Whether to load intermediate products.
- preproc_task_list: list or None
List of preprocessing tasks to run.
- verbose: bool (default=True)
If True, the code is returning more printing.
- About the “preproc_task_list” parameter. Each task should be a list containing:
task[0] = the name of the class method task[1] = a dictionary with any relevant method arguments (but not including save_utils, see task[2])
If not defined, it assumes no parameters are needed (task[1] = {}).
- task[2] = a boolean saying if the outputs should be saved in the utils folder.
Default to class save_utils if not defined for the task. If it is a string instead, it will be saved with the string as the filename.
- task[3] = a boolean saying if we should attempt to load the data from the utils folder.
Default to class load_utils if not defined for the task.
Methods Summary
compute_med_filt_badpix([save_utils])Quick bad pixel identification.
insert_psf_model([save_utils, centroid, ...])Inserts a PSF model TODO: add documentation Parameters ----------
reload_interpdata_regwvs([load_filename])Reload interpolated data onto regular wavelengths
Methods Documentation
- compute_med_filt_badpix(save_utils=False)[source]
Quick bad pixel identification.
The data is first high-pass filtered row by row with a median filter with a window size of 50 (window_size) pixels. The median absolute deviation (MAP) is then calculated row by row, and any pixel deviating by more than 50x the MAP are identified as bad.
Only returns (or save) the newly identified bad pixels, the ones already included in self.bad_pixels won’t be in new_badpix. But this map is automatically applied to self.bad_pixels: self.bad_pixels *= new_badpix
- Parameters:
- save_utilsbool or string
Save the computed bad pixel map (nans=bad) into the utils directory Default filename (set save_utils as a string instead of bool to override filename): os.path.join(self.utils_dir, os.path.basename(self.filename).replace(“.fits”, “_med_filt_badpix.fits”))
- Returns:
- new_badpixnp.array
nans = bad.