MasterBackgroundNrsSlitsStep

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

Bases: jwst.stpipe.core.JwstPipeline

Apply master background processing to NIRSpec Slit-like data

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.

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

See Step.__init__ for the parameters.

Attributes Summary

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

Attributes Documentation

prefetch_references = False
spec = '\n        force_subtract = boolean(default=False)  # Force subtracting master background\n        save_background = boolean(default=False) # Save computed master background\n        user_background = string(default=None)   # Path to user-supplied master background\n        inverse = boolean(default=False)    # Invert the operation\n        output_use_model = boolean(default=True)\n    '
step_defs = {'barshadow': <class 'jwst.barshadow.barshadow_step.BarShadowStep'>, 'flat_field': <class 'jwst.flatfield.flat_field_step.FlatFieldStep'>, 'pathloss': <class 'jwst.pathloss.pathloss_step.PathLossStep'>, 'photom': <class 'jwst.photom.photom_step.PhotomStep'>}

Methods Documentation

process(data)[source]

Compute and subtract a master background spectrum

Parameters

data (MultiSlitModel) – The data to operate on.

correction_pars

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.

Type

dict

force_subtract

Optional user-supplied flag that overrides step logic to force subtraction of the master background. Default is False, in which case the step logic determines if the calspec2 background step has already been applied and, if so, the master background step is skipped. If set to True, the step logic is bypassed and the master background is subtracted.

Type

bool, optional

save_background

Save computed master background.

Type

bool, optional

user_background

Optional user-supplied master background 1D spectrum, path to file or opened datamodel

Type

None, string, or CombinedSpecModel

Returns

result

Return type

MultiSlitModel

set_pars_from_parent()[source]

Set substep parameters from the parents substeps