fix: handle off-centre masks in convolver and blurring grid#274
Merged
fix: handle off-centre masks in convolver and blurring grid#274
Conversation
When the mask is near the image edge, the PSF blurring region can extend beyond the array boundary. The convolver now accounts for asymmetric mask positions when computing fft_shape, and the blurring grid passes allow_padding=True so off-centre datasets no longer raise MaskException. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This was referenced Apr 13, 2026
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.
Summary
fft_shapenow accounts for asymmetric mask positions viarequired_shape_for_kernel, preventingMaskExceptionwhen the blurring region extends beyond the image edgeGrid2D.blurring()passesallow_padding=Trueso off-centre masks pad gracefully instead of raisingContext
15 Euclid datasets with off-centre masks (recentered lens positions) failed with
MaskException: The input mask is too small for the kernel shape. The PSF kernel footprint extended beyond the image boundary on the crowded side.Test plan
test_fit_imaging.pytests pass (45/45)autolens_workspace_testconvolution script passes🤖 Generated with Claude Code