Add fast bilinear path to make_image_interpolations - #994
Draft
astronomyk wants to merge 1 commit into
Draft
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #984 (the axis-order fix) — the diff shown here is against that branch; GitHub will retarget to
mainonce #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. Forkx=ky=1— the case used bySpectralTrace.rectifyandMetisLMS.rectify_cube—make_image_interpolationsnow returns a direct bilinear interpolator (BilinearImageInterpolation) with identical results; other spline degrees are unchanged and keep usingRectBivariateSpline.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 againstRectBivariateSplineat 1000 scattered points, deliberately extending beyond the image.TestImageInterpolations::test_other_spline_degrees_fall_back_to_fitpack— the cubic default still returns a spline.strandHDUList+ stop manglingMETISLMSSPectralTraceparams dict #985 (LSS observe -> readout -> rectify from file).