Repository navigation
DM-55204: Raise an error if the template PSF is discontinuous - #484
Merged
Merged
Conversation
isullivan
force-pushed
the
tickets/DM-55204
branch
2 times, most recently
from
November 26, 2026 01:53
d7482d3 to
48c11cd
Compare
PSF matching fits a matching kernel that varies smoothly across the image, so it cannot follow a step in the template PSF where coadd inputs begin or end. Fit a low-order polynomial to the template PSF second moments, leaving out outlier blocks, and set REJECTED_TEMPLATE on compact subregions of DETECTED regions whose PSF width differs from the fit by more than psfDiscontinuityMaxDeviation. The new unit tests were written by Claude.
The new unit tests were written by Claude.
isullivan
force-pushed
the
tickets/DM-55204
branch
from
November 30, 2026 23:37
5406e97 to
587292b
Compare
This should take less than a second on LSSTCam images, and allows us to re-configure source detection.
isullivan
force-pushed
the
tickets/DM-55204
branch
from
December 1, 2026 04:44
bbe683f to
0ec8a54
Compare
Since we now run source detection to set the DETECTED mask plane for the template we can use the detected peaks as the points where the PSF is evaluated.
These only need to be accurate to about a pixel for determining the correct PSF model to use, and a deep coadd can be slow to evaluate.
isullivan
force-pushed
the
tickets/DM-55204
branch
from
December 1, 2026 06:31
0ec8a54 to
c6a58d6
Compare
BrunoSanchez
approved these changes
Dec 1, 2026
BrunoSanchez
left a comment
Member
There was a problem hiding this comment.
It looks good to me. The PSF difference is clever, and the fit seems a bit tedious but it is clearly explained in the comments why it needs to happen like this.
| return templateCoverageFraction | ||
|
|
||
|
|
||
| def sampleCoaddPsfMoments(psf, ra, dec, targetWcs): |
Member
There was a problem hiding this comment.
I think I understood the comparison function. I haven't checked myself the maths of known cases though.
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.
Test the template PSF, and drop detected footprints where the PSF shape is significantly different from neighboring patches. These can't be fit with the spatially-varying PSF matching kernel, and will generate junk diaSources. Do not drop entire patches or the empty regions between footprints, since these regions will not create junk diaSources and a transient can still be detected on the difference image there.