From 4dbfa54f4ecec5d9381fcef19d24f441fee69fe7 Mon Sep 17 00:00:00 2001 From: Meredith Rawls Date: Mon, 23 Dec 2024 23:50:40 -0800 Subject: [PATCH] Fix contiguous memory error. --- python/lsst/ip/diffim/subtractImages.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/python/lsst/ip/diffim/subtractImages.py b/python/lsst/ip/diffim/subtractImages.py index 8cf0f76be..d6afc3365 100644 --- a/python/lsst/ip/diffim/subtractImages.py +++ b/python/lsst/ip/diffim/subtractImages.py @@ -794,6 +794,9 @@ def _sourceSelector(self, sources, mask): remaining after source selection. """ + # Ensure the source catalog is contiguous before making any cuts + if not sources.isContiguous(): + sources = sources.copy(deep=True) selected = self.sourceSelector.selectSources(sources).selected nInitialSelected = np.count_nonzero(selected) selected *= self._checkMask(mask, sources, self.config.excludeMaskPlanes)