Skip to content

reidentify_arc_features

Re-anchor stored (pixel, λ) arc features onto a fresh arc exposure.

Category Wavelength calibration
Backend scipy - implemented here on top of scipy primitives
Version 1.0.0
Reads -
Writes extras.lamp_identifications, metrics.reidentified_fraction, metrics.median_shift_px

The complement of match_lamp_lines: that brick identifies lines against the bundled NIST atlas from scratch (IRAF identify/autoidentify); this one re-anchors a previously stored, instrument-specific feature list (IRAF reidentify). The stored wavelengths are an empirical description of one instrument unit — at low resolution blends are stable barycentres, not atlas lines — and are therefore conserved, never re-matched. Peaks are detected with the same DER_SNR-scaled prominence recipe as match_lamp_lines; each reference takes the nearest peak within search_window_px, centroids are refined to sub-pixel by a Gaussian+constant fit (refine=true), and the run fails explicitly when fewer than min_fraction of the references are recovered. Output: ctx.extras[output_key] = {'pixel_positions': [...], 'wavelengths_angstrom': [...]}.

Parameters

Parameter Default Required Description
reference_pixels None yes Stored feature positions (pixels) from the one-off identification of this instrument set-up (REQUIRED).
reference_wavelengths None yes Wavelengths (Å) paired with reference_pixels (REQUIRED). Conserved verbatim — this is an empirical feature list, not a physical atlas.
search_window_px 8.0 - Half-width (pixels) of the search window around each reference. Bounds the drift the brick will absorb; a shift beyond it is a failure, not a guess.
min_fraction 0.7 - Minimum fraction of references that must be recovered; below it the run fails explicitly (weak arc or abnormal shift → back to assisted identification).
refine True - Refine each matched peak to sub-pixel with a Gaussian+constant centroid fit.
detection_sigma 5.0 - Peak prominence threshold as a multiple of the DER_SNR-style noise (same recipe as match_lamp_lines).
min_prominence 0.01 - Floor on the prominence as a fraction of the flux amplitude.
min_distance_px 5 - Minimum spacing between detected peaks (pixels).
source_key 'lamp_spectrum' - ctx.extras key holding the arc Spectrum1D (pixel axis).
output_key 'lamp_identifications' - ctx.extras key receiving the identifications dict {'pixel_positions': [...], 'wavelengths_angstrom': [...]}.

Use it

from spectro_kernel import run_algorithm

output = run_algorithm("reidentify_arc_features", ctx, {
    "reference_pixels": "<value>",
    "reference_wavelengths": "<value>",
    "search_window_px": 8.0,
    "min_fraction": 0.7,
    "refine": True,
    "detection_sigma": 5.0,
    "min_prominence": 0.01,
    "min_distance_px": 5,
    "source_key": "lamp_spectrum",
    "output_key": "lamp_identifications"
})
spectro run reidentify_arc_features --input spectrum.fits \
  --param reference_pixels=<value> \
  --param reference_wavelengths=<value> \
  --param search_window_px=8.0 \
  --param min_fraction=0.7 \
  --param refine=true \
  --param detection_sigma=5.0 \
  --param min_prominence=0.01 \
  --param min_distance_px=5 \
  --param source_key=lamp_spectrum \
  --param output_key=lamp_identifications
{
  "tool": "reidentify_arc_features",
  "arguments": {
    "session_id": "<session_id>",
    "params": {
      "reference_pixels": "<value>",
      "reference_wavelengths": "<value>",
      "search_window_px": 8.0,
      "min_fraction": 0.7,
      "refine": true,
      "detection_sigma": 5.0,
      "min_prominence": 0.01,
      "min_distance_px": 5,
      "source_key": "lamp_spectrum",
      "output_key": "lamp_identifications"
    }
  }
}

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

References

  • Tody 1986, SPIE 627, 733 — IRAF Data Reduction and Analysis System.
  • Tody 1993, ASP Conf. Ser. 52, 173 — IRAF identify/autoidentify.