Repository navigation
Lose the PSF light that falls off the frame - #4
Merged
Merged
Conversation
MoffatPSF, EllipticalGaussianPSF and AiryPSF clipped their stamp to the frame and then normalised what was left, so a source on the edge kept its full flux. They now normalise the whole stamp first and deposit only the part on the detector, as GaussianPSF already did. A new test compares an edge source with the x >= 0 half of a fully captured image. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Problem
MoffatPSF,EllipticalGaussianPSFandAiryPSFclipped their sampled stamp to the frame, then divided by the sum of what was left. A source near the edge therefore deposited all of its flux on the detector. A Moffat star centred on column 0 kept 100%, whereGaussianPSF, which integrates exactly, keeps about half. This breaks the stack convention that light lost at a detector edge is lost, not renormalised (aocore CONVENTIONS 3.3). It was found while migrating getframes onto aocore (#3).Fix
A shared
_deposit_sampledhelper evaluates the profile on the full(2r+1)²stamp, normalises it over that stamp, and then adds only the part that lands on the frame. Sources wholly inside the frame give the same images as before, to rounding.Tests
test_psf_loses_the_flux_that_falls_off_the_frame, for Gaussian, Moffat, EllipticalGaussian and Airy: an edge source must deposit exactly thex >= 0part of a fully captured image (rel 1e-9), and less than 75% of the flux. Moffat, EllipticalGaussian and Airy fail it onmain; all four pass with the fix.🤖 Generated with Claude Code