From 62961ba315f9096f55b21914b3e1c1ac74f4d52c Mon Sep 17 00:00:00 2001 From: Lee Kelvin Date: Thu, 16 May 2024 14:49:01 -0700 Subject: [PATCH] Raise if catalog for source selection is empty --- python/lsst/meas/algorithms/sourceSelector.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/python/lsst/meas/algorithms/sourceSelector.py b/python/lsst/meas/algorithms/sourceSelector.py index 979d603fd..33ef18cff 100644 --- a/python/lsst/meas/algorithms/sourceSelector.py +++ b/python/lsst/meas/algorithms/sourceSelector.py @@ -113,6 +113,9 @@ def run(self, sourceCat, sourceSelectedField=None, matches=None, exposure=None): if not sourceCat.isContiguous(): raise RuntimeError("Input catalogs for source selection must be contiguous.") + if len(sourceCat) == 0: + raise RuntimeError("Input catalog for source selection is empty.") + result = self.selectSources(sourceCat=sourceCat, exposure=exposure, matches=matches)