Skip to content

extinction_correct_easyspec

Apply atmospheric extinction correction to ctx.spectrum via easyspec.

Category Corrections
Backend easyspec - wraps the EasySpec reduction library (optional extra reduction)
Version 1.0.1
Reads ctx.spectrum (a Spectrum1D)
Writes spectrum

Supported observatory keys depend on the installed easyspec version. Common entries include 'lapalma', 'cerropachon', 'paranal', 'kpno', 'lasilla'; pass a 2-column ASCII file via custom_observatory_path if your site is not bundled.

Parameters

Parameter Default Required Description
observatory 'lapalma' - Observatory key for the bundled extinction curve.
data_type 'target' - easyspec data_type label (target / standard_star).
airmass None yes Airmass of the observation (mandatory — extinction scales with it).
custom_observatory_path None - Optional 2-col file (wavelength, mag/airmass) for a custom site.
spline_order 1 - Spline order used to interpolate the extinction curve onto the spectrum.

Use it

from spectro_kernel import run_algorithm

output = run_algorithm("extinction_correct_easyspec", ctx, {
    "observatory": "lapalma",
    "data_type": "target",
    "airmass": "<value>",
    "custom_observatory_path": None,
    "spline_order": 1
})
spectro run extinction_correct_easyspec --input spectrum.fits \
  --param observatory=lapalma \
  --param data_type=target \
  --param airmass=<value> \
  --param custom_observatory_path=none \
  --param spline_order=1
{
  "tool": "extinction_correct_easyspec",
  "arguments": {
    "session_id": "<session_id>",
    "params": {
      "observatory": "lapalma",
      "data_type": "target",
      "airmass": "<value>",
      "custom_observatory_path": null,
      "spline_order": 1
    }
  }
}

Every algorithm is an MCP tool of the same name; describe_algorithm returns this page's metadata as JSON.

References

  • easyspec.extraction.extraction.extinction_correction.
  • air_to_vacuum - Convert the wavelength axis from air to vacuum wavelengths.
  • barycentric_correction - Compute the barycentric (or heliocentric) correction and Julian date, and shift the spectrum.
  • doppler_shift - Doppler-shift the wavelength axis by a radial velocity.
  • fit_telluric_scaling - Fit the airmass that best matches a telluric template to ctx.spectrum.
  • remove_telluric_division - Remove telluric absorption by dividing the science spectrum by a reference.
  • synth_telluric - Generate a synthetic telluric transmission spectrum.
  • vacuum_to_air - Convert the wavelength axis from vacuum to air wavelengths.