Skip to content

Commit

Permalink
Fix contiguous memory error.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrawls committed Jan 9, 2025
1 parent b092a60 commit 4dbfa54
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions python/lsst/ip/diffim/subtractImages.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 4dbfa54

Please sign in to comment.