Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DM-27547: warn about psfCandidates near edge #67

Merged
merged 1 commit into from
Feb 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions python/lsst/meas/extensions/psfex/psfexPsfDeterminer.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,8 +285,8 @@ def determinePsf(self, exposure, psfCandidateList, metadata=None, flagKey=None):
try:
pstamp = psfCandidate.getMaskedImage(pixKernelSize, pixKernelSize).clone()
except pexExcept.LengthError:
# Candidate is too close to the edge to get a stamp. Skip.
# TODO DM-27547: Replace with geometric condition
self.log.warning("Could not get stamp image for psfCandidate: %s with kernel size: %s",
psfCandidate, pixKernelSize)
continue

# From this point, we're configuring the "sample" (PSFEx's version
Expand Down
5 changes: 4 additions & 1 deletion tests/test_PsfexPsf.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,10 @@ def setUp(self):

xarr, yarr = [], []

# NOTE: Warning to those trying to add sources near the edges here:
# self.subtractStars() assumes that every source is able to have the
# psf subtracted. That's not possible for sources on the edge, so the
# chi2 calculation that is asserted on will be off.
for x, y in [(20, 20), (60, 20),
(30, 35),
(50, 50),
Expand Down Expand Up @@ -181,7 +185,6 @@ def setUp(self):
self.cellSet = afwMath.SpatialCellSet(bbox, 100)

self.footprintSet = afwDetection.FootprintSet(self.mi, afwDetection.Threshold(100), "DETECTED")

self.catalog = self.measure(self.footprintSet, self.exposure)

for source in self.catalog:
Expand Down