BadpixSelfcalStep
- class jwst.badpix_selfcal.badpix_selfcal_step.BadpixSelfcalStep(name=None, parent=None, config_file=None, _validate_kwds=True, **kws)[source]
Bases:
JwstStepFlag residual artifacts as bad pixels using a median filter and percentile cutoffs.
All input exposures in the association file (or manually-provided
bkg_list) are combined into a single background model using a MIN operation. The bad pixels are then identified using a median filter and percentile cutoffs, and applied to the science data by setting the flagged pixels, errors, and variances to NaN, and the DQ flag toDO_NOT_USE + OTHER_BAD_PIXEL.Create a
Stepinstance.- Parameters:
- namestr
The name of the Step instance. Used in logging messages and in cache filenames. If not provided, one will be generated based on the class name.
- parent
Step The parent step of this step. Used to determine a fully-qualified name for this step, and to determine the mode in which to run this step.
- config_filestr or pathlib.Path
The path to the config file that this step was initialized with. Use to determine relative path names of other config files.
- _validate_kwdsbool
Validate given
kwsagainst specs/config.- **kwsdict
Additional parameters to set. These will be set as member variables on the new Step instance.
Attributes Summary
Methods Summary
process(input_data[, selfcal_list, bkg_list])Flag residual artifacts as bad pixels in the DQ array of a JWST exposure.
save_bkg(bkg_list[, suffix])Save the background exposures to file with correct indexing.
save_model(model, *args, **kwargs)Override base step class
stpipe.Step.save_model()to suppress index 0 when save_model is True.Attributes Documentation
- class_alias = 'badpix_selfcal'
- spec
flagfrac_lower = float(default=0.001, min=0.0, max=0.5) # fraction of pixels to flag on the low-flux end flagfrac_upper = float(default=0.001, min=0.0, max=0.5) # fraction of pixels to flag on the high-flux end kernel_size = integer(default=15, min=1) # size of kernel for median filter force_single = boolean(default=False) # force single input exposure save_flagged_bkg = boolean(default=False) # save flagged background exposures to file skip = boolean(default=True)
Methods Documentation
- process(input_data, selfcal_list=None, bkg_list=None)[source]
Flag residual artifacts as bad pixels in the DQ array of a JWST exposure.
- Parameters:
- input_datastr,
ImageModel,IFUImageModel, orModelContainer Input science data to be corrected or association containing background and/or selfcal models.
- selfcal_listlist, optional
Exposures to include as part of median background model used to find bad pixels, but that are not flagged and returned as background exposures.
- bkg_listlist, optional
Exposures to include as part of median background model used to find bad pixels, and that are flagged and returned as background exposures.
- input_datastr,
- Returns:
- output
ImageModel,IFUImageModel, orModelContainer Data model with bad pixels flagged.
- output
Notes
If an association file is read in, all exposures in the association file, including science, background, and selfcal exposures, are included in the MIN frame from which outliers are detected. If
selfcal_listand/orbkg_listare specified manually, they are appended to any selfcal or background exposures found in the input association file. Ifselfcal_listandbkg_listare both set toNoneand input is a single science exposure, the step will be skipped with a warning unless the force_single parameter is setTrue. In that case, the input exposure will be used as the sole background exposure, i.e., true self-calibration.
- save_bkg(bkg_list, suffix='badpix_selfcal_bkg')[source]
Save the background exposures to file with correct indexing.
- Parameters:
- bkg_listlist of
ImageModel Background exposures to save
- suffixstr
Suffix to append to the filename
- bkg_listlist of
- save_model(model, *args, **kwargs)[source]
Override base step class
stpipe.Step.save_model()to suppress index 0 when save_model is True.- Parameters:
- model
JwstDataModel Data model to save
- *argstuple
Additional arguments to pass to
stpipe.Step.save_model()- **kwargsdict
Additional keyword arguments to pass to
stpipe.Step.save_model()
- model
- Returns:
- list[str]
List of output paths for the saved models