Skip to content

Add fast bilinear path to make_image_interpolations - #994

Draft
astronomyk wants to merge 1 commit into
fix/image-interpolation-axesfrom
perf/bilinear-image-interpolations
Draft

Add fast bilinear path to make_image_interpolations#994
astronomyk wants to merge 1 commit into
fix/image-interpolation-axesfrom
perf/bilinear-image-interpolations

Conversation

@astronomyk

Copy link
Copy Markdown
Collaborator

Stacked on #984 (the axis-order fix) — the diff shown here is against that branch; GitHub will retarget to main once #984 merges.

What

Rectification evaluates the detector-image interpolators at every pixel of the rectified grid via grid=False, which goes through FITPACK's slow scattered-point path. For kx=ky=1 — the case used by SpectralTrace.rectify and MetisLMS.rectify_cubemake_image_interpolations now returns a direct bilinear interpolator (BilinearImageInterpolation) with identical results; other spline degrees are unchanged and keep using RectBivariateSpline.

The interpolator keeps the (j, i) call convention documented in #984 and the clamping behaviour at the image edges.

Testing

  • TestImageInterpolations::test_bilinear_matches_spline_evaluation — equivalence against RectBivariateSpline at 1000 scattered points, deliberately extending beyond the image.
  • TestImageInterpolations::test_other_spline_degrees_fall_back_to_fitpack — the cubic default still returns a spline.
  • The full rectification path is exercised end-to-end by the notebook attached to Rectify now accepts str and HDUList + stop mangling METISLMSSPectralTrace params dict #985 (LSS observe -> readout -> rectify from file).

Rectification evaluates the detector-image interpolators at every
pixel of the rectified grid via grid=False, which goes through
FITPACK's slow scattered-point path. For kx=ky=1 (the case used by
SpectralTrace.rectify and MetisLMS rectify_cube) return a direct
bilinear interpolator with identical results instead; other spline
degrees are unchanged and keep using RectBivariateSpline.

The interpolator keeps the (j, i) call convention and the clamping
behaviour at the image edges.

Adds an equivalence test against RectBivariateSpline (including
out-of-image coordinates) and a fallback-type test.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant