Skip to content

Allow non-square images in the prepsfmom fitters - #273

Merged
beckermr merged 1 commit into
masterfrom
prepsfmom-nonsquare
Aug 25, 2026
Merged

Allow non-square images in the prepsfmom fitters#273
beckermr merged 1 commit into
masterfrom
prepsfmom-nonsquare

Conversation

@esheldon

Copy link
Copy Markdown
Owner

Split out of #271 at reviewer request.

The pre-PSF moment fitters (KSigmaMom, PGaussMom) previously raised on non-square images. They now zero pad to square internally: the target dimension is the largest dimension of the image and psf times pad_factor, and the effective pad factor used to scale the noise is the ratio of padded to unpadded pixel counts. Apodization still works correctly. _zero_pad_image now pads each axis separately and returns the row and column offsets.

Tests cover trimming either axis and check results against the square case.

🤖 Generated with Claude Code

https://claude.ai/code/session_01PK1a41EiKVLGjyq3Bp6RGa

Internally the images are zero padded to square, and apodization
still works correctly.  The effective pad factor used to scale the
noise is now the ratio of padded to unpadded pixel counts.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PK1a41EiKVLGjyq3Bp6RGa
@esheldon

Copy link
Copy Markdown
Owner Author

Claude code was used to split this from #271

@esheldon
esheldon requested a review from beckermr August 24, 2026 15:37
@beckermr
beckermr merged commit 4602c86 into master Aug 25, 2026
6 checks passed
@beckermr
beckermr deleted the prepsfmom-nonsquare branch August 25, 2026 19:26
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.

2 participants