diff --git a/python/lsst/ip/diffim/subtractImages.py b/python/lsst/ip/diffim/subtractImages.py index 6f8e9db5..3802c646 100644 --- a/python/lsst/ip/diffim/subtractImages.py +++ b/python/lsst/ip/diffim/subtractImages.py @@ -822,7 +822,8 @@ def _sourceSelector(self, sources, mask): self.log.error("Too few sources to calculate the PSF matching kernel: " "%i selected but %i needed for the calculation.", len(selectSources), self.config.minKernelSources) - raise RuntimeError("Cannot compute PSF matching kernel: too few sources selected.") + if not self.config.allowKernelSourceDetection: + raise RuntimeError("Cannot compute PSF matching kernel: too few sources selected.") self.metadata["nPsfSources"] = len(selectSources) return selectSources