From 973ce95889a29f4ff4e43dec8a8823b6ca7605f1 Mon Sep 17 00:00:00 2001 From: Kyle Oman Date: Thu, 10 Oct 2024 20:25:02 +0100 Subject: [PATCH] Use correct index in masking (mainly for soap). --- swiftgalaxy/halo_catalogues.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/swiftgalaxy/halo_catalogues.py b/swiftgalaxy/halo_catalogues.py index 1395441..c6421f5 100644 --- a/swiftgalaxy/halo_catalogues.py +++ b/swiftgalaxy/halo_catalogues.py @@ -350,8 +350,8 @@ def __getattr__(self, attr: str) -> Any: except AttributeError: return None obj = getattr(self._catalogue, attr) - if self._multi_galaxy_catalogue_mask is not None: - return _MaskHelper(obj, self._multi_galaxy_catalogue_mask) + if self._multi_galaxy_index_mask is not None: + return _MaskHelper(obj, self._multi_galaxy_index_mask) else: return obj @@ -834,8 +834,8 @@ def centre(self) -> cosmo_array: obj = self._catalogue for attr in self.centre_type.split("."): obj = getattr(obj, attr) - if self._multi_galaxy_catalogue_mask is not None: - return obj[self._multi_galaxy_catalogue_mask] + if self._multi_galaxy_index_mask is not None: + return obj[self._multi_galaxy_index_mask] return obj.squeeze() @property @@ -855,8 +855,8 @@ def velocity_centre(self) -> cosmo_array: obj = self._catalogue for attr in self.velocity_centre_type.split("."): obj = getattr(obj, attr) - if self._multi_galaxy_catalogue_mask is not None: - return obj[self._multi_galaxy_catalogue_mask] + if self._multi_galaxy_index_mask is not None: + return obj[self._multi_galaxy_index_mask] return obj.squeeze() def __repr__(self) -> str: