From c4c4304eefbef09fb4107ab8ca9f6686dad8b937 Mon Sep 17 00:00:00 2001 From: Ian Sullivan Date: Mon, 4 Nov 2024 11:52:31 -0800 Subject: [PATCH] Do not raise an error in source selection if allowKernelSourceDetection=True --- python/lsst/ip/diffim/subtractImages.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python/lsst/ip/diffim/subtractImages.py b/python/lsst/ip/diffim/subtractImages.py index 6f8e9db5..2c29e9ca 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 ~self.config.allowKernelSourceDetection: + raise RuntimeError("Cannot compute PSF matching kernel: too few sources selected.") self.metadata["nPsfSources"] = len(selectSources) return selectSources