Closed bwvdnbro closed 2 years ago
Hmm I definitely do not like this, patching into the load
function is dodgy as maybe internal APIs used the VelociraptorCatalogue
object directly somewhere.
Can you add centrals
and satellites
as properties?
@property
def centrals(self):
if hasattr(self.structure_type, "structuretype"):
return self.structure_type.structuretype == 10
else
return np.s_[:]
@property
def satellites(self):
if hasattr(self.structure_type, "structuretype"):
return self.structure_type.structuretype != 10
else
return np.s_[:]
Done. That is a lot cleaner indeed.
As requested in #74, this adds a convenience mask for centrals and satellites to the catalogue. It's not very pretty, but it does the job.