Skip to content

Commit

Permalink
Add check for NaN PSF sigma
Browse files Browse the repository at this point in the history
  • Loading branch information
isullivan committed Nov 27, 2024
1 parent 1a0ca8c commit b66c389
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions python/lsst/meas/algorithms/installGaussianPsf.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ def run(self, exposure):
if exposure.hasPsf():
psfModel = exposure.getPsf()
psfSigma = psfModel.computeShape(psfModel.getAveragePosition()).getDeterminantRadius()
if math.isnan(psfSigma):
raise RuntimeError("Cannot create a Gaussian PSF model. "
"The computed exposure psfSigma is NaN!")
width, height = psfModel.computeImage(psfModel.getAveragePosition()).getDimensions()
else:
psfSigma = self.config.fwhm / FwhmPerSigma
Expand Down

0 comments on commit b66c389

Please sign in to comment.