Skip to content

correct_smile_polynomial

Undo smile curvature via the Schroeder even-order expansion.

Category Preprocessing (2-D image)
Backend scipy - implemented here on top of scipy primitives
Version 1.0.0
Reads ctx.image (an ImageFrame)
Writes image

Computes the column-displacement field from the paraxial Seidel expansion, then resamples with scipy.ndimage.map_coordinates (order=1, zero-fill outside). Reference row is the optical axis (usually the science trace) — no displacement there.

Parameters

Parameter Default Required Description
reference_row 0 yes Optical-axis row y₀ (no lateral shift there); use the trace row.
smile_radius 0.0 yes Smile radius R in pixels (instrument-specific). 0 disables.
polynomial_order 6 - Highest even power kept: one of 2, 4, 6.

Use it

from spectro_kernel import run_algorithm

output = run_algorithm("correct_smile_polynomial", ctx, {
    "reference_row": 0,
    "smile_radius": 0.0,
    "polynomial_order": 6
})

The CLI loads a single 1-D spectrum with --input; this algorithm needs ctx.image (an ImageFrame). Run it from Python or as a step of a pipeline preset.

{
  "tool": "correct_smile_polynomial",
  "arguments": {
    "session_id": "<session_id>",
    "params": {
      "reference_row": 0,
      "smile_radius": 0.0,
      "polynomial_order": 6
    }
  }
}

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

References

  • Schroeder 2000, Astronomical Optics 2nd ed. ch.15 §15.3 — off-axis aberration expansion.
  • Bottema 1980, Appl. Opt. 19, 444 — smile curvature in concave-grating spectrographs.