Skip to content

wavelength_calibrate_easyspec

Fit a wavelength polynomial via extraction.wavelength_calibration and apply it.

Category Wavelength calibration
Backend easyspec - wraps the EasySpec reduction library (optional extra reduction)
Version 1.0.1
Reads ctx.spectrum (a Spectrum1D)
Writes spectrum, extras.wavelength_polynomial_coefficients

Lamp peaks must be pre-identified — typically you run an arc-lamp through extract_spectrum_easyspec first, pick the line peaks (e.g. with detect_lines) and match them to a reference list (NIST, NeAr…). The matched (pixel, wavelength) pairs feed this algorithm.

Parameters

Parameter Default Required Description
lamp_peak_positions None yes List of identified peak pixel positions in the arc-lamp spectrum.
corresponding_wavelengths None yes Reference wavelengths (Å) for those peaks, same length.
poly_order 2 - Polynomial order of the wavelength fit.
data_type 'target' - easyspec data_type label (target / standard_star).

Use it

from spectro_kernel import run_algorithm

output = run_algorithm("wavelength_calibrate_easyspec", ctx, {
    "lamp_peak_positions": "<value>",
    "corresponding_wavelengths": "<value>",
    "poly_order": 2,
    "data_type": "target"
})
spectro run wavelength_calibrate_easyspec --input spectrum.fits \
  --param lamp_peak_positions=<value> \
  --param corresponding_wavelengths=<value> \
  --param poly_order=2 \
  --param data_type=target
{
  "tool": "wavelength_calibrate_easyspec",
  "arguments": {
    "session_id": "<session_id>",
    "params": {
      "lamp_peak_positions": "<value>",
      "corresponding_wavelengths": "<value>",
      "poly_order": 2,
      "data_type": "target"
    }
  }
}

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

References

  • easyspec.extraction.extraction.wavelength_calibration.