Skip to content

Commit

Permalink
Merge pull request #1000 from lsst/tickets/DM-46852
Browse files Browse the repository at this point in the history
DM-46852: Return None for the PSF if the computed shape is NAN
  • Loading branch information
isullivan authored Nov 9, 2024
2 parents 6456693 + 08e0668 commit 833419f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions python/lsst/pipe/tasks/finalizeCharacterization.py
Original file line number Diff line number Diff line change
Expand Up @@ -716,6 +716,13 @@ def compute_psf_and_ap_corr_map(self, visit, detector, exposure, src, isolated_s
self.log.warning('Failed to determine psf for visit %d, detector %d: %s',
visit, detector, e)
return None, None, measured_src
# Verify that the PSF is usable by downstream tasks
sigma = psf.computeShape(psf.getAveragePosition()).getDeterminantRadius()
if np.isnan(sigma):
self.log.warning('Failed to determine psf for visit %d, detector %d: '
'Computed final PSF size is NAN.',
visit, detector)
return None, None, measured_src

# Set the psf in the exposure for measurement/aperture corrections.
exposure.setPsf(psf)
Expand Down

0 comments on commit 833419f

Please sign in to comment.