Skip to content

Commit

Permalink
Merge pull request #67 from lsst/tickets/DM-27547
Browse files Browse the repository at this point in the history
DM-27547: warn about psfCandidates near edge
  • Loading branch information
parejkoj committed Feb 8, 2023
2 parents 0da5cf3 + fed1743 commit f0d5218
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
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

0 comments on commit f0d5218

Please sign in to comment.