Skip to content

wavelength_calibration_in_situ

Refine the wavelength zero-point from simultaneously-acquired sky lines.

Category Wavelength calibration
Backend astropy - wraps the domain-standard astropy implementation
Version 1.0.0
Reads ctx.spectrum (a Spectrum1D)
Writes spectrum, metrics.mean_delta_angstrom, metrics.rms_residual_angstrom

The polynomial coefficients describe the initial wavelength solution (highest order first, as accepted by numpy.poly1d). The Δλ shift is the zero-point refinement — slope and higher-order coefficients are kept. RMS of residuals after subtracting the mean Δλ measures how well a pure zero-point shift explains the calibration error; large RMS means the initial polynomial itself needs re-fitting (use wavelength_calibrate_polynomial).

Parameters

Parameter Default Required Description
polynomial_coef [] yes Initial λ(x) coefficients, highest order first (numpy.poly1d).
reference_wavelengths [] yes Catalogue λ (Å) of the reference lines, same length as guesses.
guess_positions [] yes Pixel positions of those lines in the sky spectrum.
search_width 40.0 - Fit-window width (px) forwarded to the line fitter.
sky_key 'sky_spectrum' - ctx.extras key holding the sky reference Spectrum1D.
oversampling 2.0 - Uniform-grid oversampling factor vs. the native pixel step (≥ 1).

Use it

from spectro_kernel import run_algorithm

output = run_algorithm("wavelength_calibration_in_situ", ctx, {
    "polynomial_coef": [],
    "reference_wavelengths": [],
    "guess_positions": [],
    "search_width": 40.0,
    "sky_key": "sky_spectrum",
    "oversampling": 2.0
})
spectro run wavelength_calibration_in_situ --input spectrum.fits \
  --param polynomial_coef=[] \
  --param reference_wavelengths=[] \
  --param guess_positions=[] \
  --param search_width=40.0 \
  --param sky_key=sky_spectrum \
  --param oversampling=2.0
{
  "tool": "wavelength_calibration_in_situ",
  "arguments": {
    "session_id": "<session_id>",
    "params": {
      "polynomial_coef": [],
      "reference_wavelengths": [],
      "guess_positions": [],
      "search_width": 40.0,
      "sky_key": "sky_spectrum",
      "oversampling": 2.0
    }
  }
}

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

References

  • Stoughton et al. 2002, AJ 123, 485 — SDSS in-situ wavelength refinement from night-sky lines.
  • Hanuschik 2003, A&A 407, 1157 — UVES optical sky atlas.