Skip to content

fix: handle off-centre masks in convolver and blurring grid#274

Merged
Jammy2211 merged 1 commit intomainfrom
feature/mask-padding-off-centre
Apr 13, 2026
Merged

fix: handle off-centre masks in convolver and blurring grid#274
Jammy2211 merged 1 commit intomainfrom
feature/mask-padding-off-centre

Conversation

@Jammy2211
Copy link
Copy Markdown
Collaborator

Summary

  • Convolver fft_shape now accounts for asymmetric mask positions via required_shape_for_kernel, preventing MaskException when the blurring region extends beyond the image edge
  • Grid2D.blurring() passes allow_padding=True so off-centre masks pad gracefully instead of raising

Context

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

  • Existing test_fit_imaging.py tests pass (45/45)
  • New unit test in PyAutoLens verifies padded vs non-padded likelihoods match
  • Integration test in autolens_workspace_test convolution script passes

🤖 Generated with Claude Code

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>
@Jammy2211 Jammy2211 merged commit c11846a into main Apr 13, 2026
4 checks passed
@Jammy2211 Jammy2211 deleted the feature/mask-padding-off-centre branch April 13, 2026 10:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant