Skip to content

correct_slant_affine

Make monochromatic lines parallel to the rows by a horizontal shear.

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

scipy.ndimage.affine_transform with shear [[1, 0], [-tan θ, 1]] and offset [0, tan θ · pivot_row], order=1 bilinear. Zero slant is a no-op.

Parameters

Parameter Default Required Description
slant_deg 0.0 - Slant angle of monochromatic lines (degrees).
pivot_row 0 - Row where the shear has zero displacement (use the trace row).

Use it

from spectro_kernel import run_algorithm

output = run_algorithm("correct_slant_affine", ctx, {
    "slant_deg": 0.0,
    "pivot_row": 0
})

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_slant_affine",
  "arguments": {
    "session_id": "<session_id>",
    "params": {
      "slant_deg": 0.0,
      "pivot_row": 0
    }
  }
}

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

References

  • Howell 2006, Handbook of CCD Astronomy 2nd ed. §5.2 (Cambridge UP).
  • Tody 1986, Proc. SPIE 627, 733 — IRAF transform heritage.