Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion python/lsst/ip/diffim/psfMatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -858,7 +858,20 @@ def _solve(self, kernelCellSet, basisList):
ksv.resetKernelSum()
ksv.setMode(diffimLib.KernelSumVisitorF.AGGREGATE)
kernelCellSet.visitCandidates(ksv, nStarPerCell, ignoreExceptions=True)
ksv.processKsumDistribution()

allCellsEmpty = True
for cell in kernelCellSet.getCellList():
if not cell.empty():
allCellsEmpty = False
break
if allCellsEmpty:
raise NoKernelCandidatesError("All spatial cells are emtpy of candidates")

try:
ksv.processKsumDistribution()
except RuntimeError as e:
raise NoKernelCandidatesError("Unable to calculate the kernel sum") from e

ksv.setMode(diffimLib.KernelSumVisitorF.REJECT)
kernelCellSet.visitCandidates(ksv, nStarPerCell, ignoreExceptions=True)

Expand Down