Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions SOAP/particle_selection/halo_properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ def __init__(self, cellgrid):
self.softening_of_parttype = {
"PartType0": cellgrid.baryon_softening,
"PartType1": cellgrid.dark_matter_softening,
"PartType3": cellgrid.baryon_softening,
"PartType4": cellgrid.baryon_softening,
"PartType5": cellgrid.baryon_softening,
"PartType6": cellgrid.nu_softening,
Expand Down
19 changes: 18 additions & 1 deletion SOAP/particle_selection/subhalo_properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,14 @@ def dm_mask_sh(self) -> NDArray[bool]:
"""
return self.types == 1

@lazy_property
def sink_mask_sh(self) -> NDArray[bool]:
"""
Mask used to mask out sink particles that belong to this subhalo in
arrays containing all particles, e.g. self.mass.
"""
return self.types == 3

@lazy_property
def star_mask_sh(self) -> NDArray[bool]:
"""
Expand Down Expand Up @@ -217,6 +225,13 @@ def Ndm(self) -> int:
"""
return self.dm_mask_sh.sum()

@lazy_property
def Nsink(self) -> int:
"""
Number of sink particles in the subhalo.
"""
return self.sink_mask_sh.sum()

@lazy_property
def Nstar(self) -> int:
"""
Expand Down Expand Up @@ -2540,6 +2555,7 @@ def __init__(
self.particle_properties = {
"PartType0": ["Coordinates", "Masses", "Velocities", "GroupNr_bound"],
"PartType1": ["Coordinates", "Masses", "Velocities", "GroupNr_bound"],
"PartType3": ["Coordinates", "Masses", "Velocities", "GroupNr_bound"],
"PartType4": ["Coordinates", "Masses", "Velocities", "GroupNr_bound"],
"PartType5": [
"Coordinates",
Expand Down Expand Up @@ -2603,6 +2619,7 @@ def calculate(self, input_halo, search_radius, data, halo_result):
{
"BoundSubhalo/NumberOfDarkMatterParticles": part_props.Ndm,
"BoundSubhalo/NumberOfGasParticles": part_props.Ngas,
"BoundSubhalo/NumberOfSinkParticles": part_props.Nsink,
"BoundSubhalo/NumberOfStarParticles": part_props.Nstar,
"BoundSubhalo/NumberOfBlackHoleParticles": part_props.Nbh,
},
Expand All @@ -2612,7 +2629,7 @@ def calculate(self, input_halo, search_radius, data, halo_result):
# If not, we need to try again with a larger search radius.
# For HBT this should not happen since we use the radius of the most distant
# bound particle.
Ntot = part_props.Ngas + part_props.Ndm + part_props.Nstar + part_props.Nbh
Ntot = part_props.Ngas + part_props.Ndm + part_props.Nsink + part_props.Nstar + part_props.Nbh
Nexpected = input_halo["nr_bound_part"]
if Ntot < Nexpected:
# Try again with a larger search radius
Expand Down
Loading