Skip to content

Commit

Permalink
Use correct index in masking (mainly for soap).
Browse files Browse the repository at this point in the history
  • Loading branch information
kyleaoman committed Oct 10, 2024
1 parent c3087ee commit 973ce95
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions swiftgalaxy/halo_catalogues.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand All @@ -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:
Expand Down

0 comments on commit 973ce95

Please sign in to comment.