MasterBackgroundMosStep

class jwst.master_background.MasterBackgroundMosStep(*args, **kwargs)[source]

Bases: JwstPipeline

Apply master background processing to NIRSpec MOS data.

See Step for the parameters.

Attributes Summary

class_alias

prefetch_references

spec

step_defs

Methods Summary

process(data)

Compute and subtract a master background spectrum.

set_pars_from_parent()

Set substep parameters from the parents substeps when needed.

Attributes Documentation

class_alias = 'master_background_mos'
prefetch_references = False
spec
sigma_clip = float(default=3) # Factor for clipping outliers when combining spectra
median_kernel = integer(default=1) # Moving-median boxcar size to filter background spec
force_subtract = boolean(default=False)  # Force subtracting master background
save_background = boolean(default=False) # Save computed master background
user_background = string(default=None)   # Path to user-supplied master background
inverse = boolean(default=False)    # Invert the operation
output_use_model = boolean(default=True)
step_defs: ClassVar = {'barshadow': <class 'jwst.barshadow.barshadow_step.BarShadowStep'>, 'extract_1d': <class 'jwst.extract_1d.extract_1d_step.Extract1dStep'>, 'flat_field': <class 'jwst.flatfield.flat_field_step.FlatFieldStep'>, 'pathloss': <class 'jwst.pathloss.pathloss_step.PathLossStep'>, 'photom': <class 'jwst.photom.photom_step.PhotomStep'>, 'pixel_replace': <class 'jwst.pixel_replace.pixel_replace_step.PixelReplaceStep'>, 'resample_spec': <class 'jwst.resample.resample_spec_step.ResampleSpecStep'>}

Methods Documentation

process(data)[source]

Compute and subtract a master background spectrum.

For MOS, and ignoring FS, the calibration process needs to occur twice. Once, to calibrate background slits and create a master background. Then, a second time to calibrate science using the master background.

For repeating or undoing the correction, this step makes use of two special attributes:

correction_parsdict

The master background information from a previous invocation of the step. Keys are:

  • “masterbkg_1d”: CombinedSpecModel

    The 1D version of the master background.

  • “masterbkg_2d”: MultiSlitModel

    The 2D slit-based version of the master background.

use_correction_parsbool

Use the corrections stored in correction_pars.

Parameters:
dataMultiSlitModel

The data to operate on.

Returns:
resultMultiSlitModel

The background corrected data.

Notes

The algorithm is as follows:

  • Calibrate all slits. For each step:

    • Force the source type to be extended source for all slits.

    • Return the correction array used.

  • Create the 1D master background

  • For each slit:

    • Expand out the 1D master background to match the 2D wavelength grid of the slit.

    • Reverse-calibrate the 2D background, using the correction arrays calculated above.

    • Subtract the background from the input slit data.

set_pars_from_parent()[source]

Set substep parameters from the parents substeps when needed.