Skip to content

Commit

Permalink
Return None for the PSF if the computed shape is NAN
Browse files Browse the repository at this point in the history
  • Loading branch information
isullivan committed Nov 8, 2024
1 parent 282ba76 commit b7d96e4
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 @@ -690,6 +690,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 b7d96e4

Please sign in to comment.