Skip to content

wavelength_calibration_solar

Calibrate a solar spectrum from built-in Fraunhofer line wavelengths.

Category Wavelength calibration
Backend scipy - implemented here on top of scipy primitives
Version 2.0.0
Reads ctx.spectrum (a Spectrum1D)
Writes spectrum, extras.wavelength_polynomial_coefficients, metrics.n_matched_lines, metrics.fit_rms_angstrom

Built-in catalogue of 15 strong Fraunhofer lines (Ca II K/H, Hβ, Mg b triplet, Na D, Hα, O2 telluric bands). Use the solar or daylight twilight spectrum directly as input; no arc lamp needed. Set min_lines_for_fit ≥ poly_order + 1 — typically 5+. approx_wavelength_min_angstrom helps the matcher choose the right Fraunhofer line per peak. The pixel axis is 0-based. v2.0.0: when several detected peaks fall within match_tolerance_angstrom of the same catalogue line, the peak whose approximate wavelength is closest to that line is kept — v1 compared the catalogue wavelength with itself and therefore always kept the first peak encountered (a spurious dip a few Å blueward of a real line displaced the identification and the fit).

Parameters

Parameter Default Required Description
approx_wavelength_min_angstrom 3800.0 yes Approximate wavelength (Å) of pixel 0 — used as the starting point of the peak-to-Fraunhofer matcher.
approx_dispersion_angstrom_per_pixel 1.0 yes Dispersion estimate (Å / pixel) for the grating + camera combination. Read it off the instrument documentation.
poly_order 3 - Polynomial order of the fitted λ(x) (typically 2 or 3).
min_lines_for_fit 5 - Refuse to fit fewer than this many matched lines (must be ≥ poly_order + 1).
match_tolerance_angstrom 8.0 - Maximum residual (Å) between a peak's approximate wavelength and the nearest Fraunhofer line for the match to count.
peak_prominence_quantile 0.5 - scipy.signal.find_peaks prominence threshold expressed as a quantile of the inverted-spectrum amplitude (0..1, higher = stricter).
peak_min_distance_pixels 5 - Minimum spacing between detected peaks (pixels).

Use it

from spectro_kernel import run_algorithm

output = run_algorithm("wavelength_calibration_solar", ctx, {
    "approx_wavelength_min_angstrom": 3800.0,
    "approx_dispersion_angstrom_per_pixel": 1.0,
    "poly_order": 3,
    "min_lines_for_fit": 5,
    "match_tolerance_angstrom": 8.0,
    "peak_prominence_quantile": 0.5,
    "peak_min_distance_pixels": 5
})
spectro run wavelength_calibration_solar --input spectrum.fits \
  --param approx_wavelength_min_angstrom=3800.0 \
  --param approx_dispersion_angstrom_per_pixel=1.0 \
  --param poly_order=3 \
  --param min_lines_for_fit=5 \
  --param match_tolerance_angstrom=8.0 \
  --param peak_prominence_quantile=0.5 \
  --param peak_min_distance_pixels=5
{
  "tool": "wavelength_calibration_solar",
  "arguments": {
    "session_id": "<session_id>",
    "params": {
      "approx_wavelength_min_angstrom": 3800.0,
      "approx_dispersion_angstrom_per_pixel": 1.0,
      "poly_order": 3,
      "min_lines_for_fit": 5,
      "match_tolerance_angstrom": 8.0,
      "peak_prominence_quantile": 0.5,
      "peak_min_distance_pixels": 5
    }
  }
}

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

References

  • Delbouille, Roland & Neven 1973, Atlas du spectre solaire — high-resolution Fraunhofer atlas.
  • Kurucz 2005, Mem. Soc. Astron. It. Suppl. 8, 14 — synthetic solar atlas (BASS2000).
  • Tody 1986, Proc. SPIE 627, 733 — IRAF identify heritage.