Skip to content

Commit

Permalink
Return useful messages if PSF shape is ill-defined
Browse files Browse the repository at this point in the history
  • Loading branch information
arunkannawadi committed Feb 7, 2022
1 parent d27a22a commit adfaec9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion python/lsst/meas/extensions/gaap/_gaap.py
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,13 @@ def _gaussianizeAndMeasure(self, measRecord: lsst.afw.table.SourceRecord,
wcs = exposure.getWcs()

psfSigma = psf.computeShape(center).getTraceRadius()
errorCollection = dict()
if not (psfSigma > 0): # This captures NaN and negative values.
errorCollection = {str(scalingFactor): measBase.MeasurementError("PSF size could not be measured")
for scalingFactor in self.config.scalingFactor}
raise GaapConvolutionError(errorCollection)
else:
errorCollection = dict()

for scalingFactor in self.config.scalingFactors:
targetSigma = scalingFactor*psfSigma
# If this target PSF is bound to fail for all apertures,
Expand Down

0 comments on commit adfaec9

Please sign in to comment.