hispecdrp.primitives.telluric_correction.telluric_primitive

Classes

TelluricCorrectionPrimitive([dataset, ...])

class TelluricCorrectionPrimitive(dataset=None, config=None, context=None, log_config=None, parent=None, **kwargs)[source]

Bases: BasePrimitive

Parameters:
  • input (str or L1Model/L2Model) – Input file path or data model to process. Currently, this is expected to be either a level 1 (uncalibrated) or level 2 (calibrated) data product.

  • suffix (str or None, optional) – Suffix to append to the output filename. Default is 'tell'.

  • method (str, optional) – Method to use for telluric correction. Currently, only 'airmass_scaling' is implemented. Default is 'airmass_scaling'.

  • do_orders (list of int or None, optional) – List of orders to process. If None, all orders will be processed. Default is None.

  • sci_fiber (int or None, optional) – Science fiber number to use for telluric correction. If None, the science fiber will be determined from the input model’s metadata. Default is None.

Calibrations:

lsf (GaussianLSFModel) –

Returns:

output – The telluric corrected level 2 data model with updated error and data quality arrays.

_create_preview()[source]

Build an interactive Plotly preview of the telluric correction.

Assumes the correction routine (e.g. airmass_scale_singlemodel) stores, for the science fiber:

  • SPEC_FIB{sci} — telluric-corrected science spectrum

  • SPEC_ERR_FIB{sci} — corrected error

  • WAVE_FIB{sci} — wavelength grid

  • TELLURIC_FIB{sci} — telluric transmission/correction curve applied

and that the input model (still reachable via output_model, or cached separately) has the pre-correction spectrum under SPEC_FIB{sci} / SPEC_UNCAL_FIB{sci}. Adjust the attribute names below if your airmass_scale_singlemodel implementation names things differently.