Skip to content

Commit 4cdb532

Browse files
authored
Merge pull request #804 from lsst/tickets/DM-51672
DM-51672: Improve failure modes for MultibandExposure PSF generation
2 parents 81db2e9 + e79c428 commit 4cdb532

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

python/lsst/afw/image/_exposure/_multiband.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,11 @@ class IncompleteDataError(Exception):
5252
The full list of bands in the `MultibandExposure` generating
5353
the PSF.
5454
"""
55-
def __init__(self, bands, position, partialPsf):
56-
missingBands = [band for band in bands if band not in partialPsf.bands]
55+
def __init__(self, bands, position, partialPsf=None):
56+
if partialPsf is None:
57+
missingBands = bands
58+
else:
59+
missingBands = [band for band in bands if band not in partialPsf.bands]
5760

5861
self.missingBands = missingBands
5962
self.position = position
@@ -100,6 +103,9 @@ def computePsfImage(psfModels, position, useKernelImage=True):
100103
except InvalidParameterError:
101104
incomplete = True
102105

106+
if len(psfs) == 0:
107+
raise IncompleteDataError(list(psfModels.keys()), position, None)
108+
103109
left = np.min([psf.getBBox().getMinX() for psf in psfs.values()])
104110
bottom = np.min([psf.getBBox().getMinY() for psf in psfs.values()])
105111
right = np.max([psf.getBBox().getMaxX() for psf in psfs.values()])

0 commit comments

Comments
 (0)