Skip to content

Commit

Permalink
Throw better error message for PSF shape fails
Browse files Browse the repository at this point in the history
  • Loading branch information
arunkannawadi committed Oct 13, 2022
1 parent 5f450c7 commit cc4bbbe
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions python/lsst/meas/deblender/sourceDeblendTask.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,15 @@ def deblend(self, exposure, srcs, psf):
center = fp.getCentroid()
psf_fwhm = self._getPsfFwhm(psf, center)

if not (psf_fwhm > 0):
if self.config.catchFailures:
self.log.warning("Unable to deblend source %d: because PSF FWHM=%f is invalid.",
src.getId(), psf_fwhm)
src.set(self.deblendFailedKey, True)
continue
else:
raise ValueError(f"PSF at {center} has an invalid FWHM value of {psf_fwhm}")

self.log.trace('Parent %i: deblending %i peaks', int(src.getId()), len(pks))

self.preSingleDeblendHook(exposure, srcs, i, fp, psf, psf_fwhm, sigma1)
Expand Down

0 comments on commit cc4bbbe

Please sign in to comment.