Skip to content

wavelength_calibrate_polynomial

Fit a polynomial to (pixel → wavelength) pairs and apply it to the spectrum.

Category Wavelength calibration
Backend numpy - implemented here on top of numpy primitives
Version 1.0.1
Reads ctx.spectrum (a Spectrum1D)
Writes spectrum, metrics.calibration_rms_angstrom

The polynomial is fitted with numpy.polynomial.Polynomial.fit, which handles the domain mapping so high orders stay well-conditioned. pixel_positions are 0-based indices on the current ctx.spectrum.wavelength axis (see the class docstring).

Parameters

Parameter Default Required Description
pixel_positions None yes List of 0-based pixel indices identified in the arc spectrum (same frame as ctx.spectrum.wavelength; first sample = 0).
wavelengths_angstrom None yes Rest wavelengths corresponding to those pixels (Å).
order 3 - Polynomial degree.

Use it

from spectro_kernel import run_algorithm

output = run_algorithm("wavelength_calibrate_polynomial", ctx, {
    "pixel_positions": "<value>",
    "wavelengths_angstrom": "<value>",
    "order": 3
})
spectro run wavelength_calibrate_polynomial --input spectrum.fits \
  --param pixel_positions=<value> \
  --param wavelengths_angstrom=<value> \
  --param order=3
{
  "tool": "wavelength_calibrate_polynomial",
  "arguments": {
    "session_id": "<session_id>",
    "params": {
      "pixel_positions": "<value>",
      "wavelengths_angstrom": "<value>",
      "order": 3
    }
  }
}

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

References

  • Tody 1986, Proc. SPIE 627, 733 — IRAF identify: polynomial dispersion solution fitted through identified arc lines.
  • Tody 1993, ASP Conf. Ser. 52, 173 — IRAF in the Nineties (identify / dispcor dispersion functions).