aboutsummaryrefslogtreecommitdiffstats
path: root/fg21sim
diff options
context:
space:
mode:
Diffstat (limited to 'fg21sim')
-rw-r--r--fg21sim/extragalactic/clusters/halo.py29
1 files changed, 11 insertions, 18 deletions
diff --git a/fg21sim/extragalactic/clusters/halo.py b/fg21sim/extragalactic/clusters/halo.py
index 14a9028..b11f060 100644
--- a/fg21sim/extragalactic/clusters/halo.py
+++ b/fg21sim/extragalactic/clusters/halo.py
@@ -774,27 +774,12 @@ class RadioHaloAM(RadioHalo1M):
"""
return self.age_merger[-1]
- def _merger_idx(self, t):
- """
- Determine the index of the merger event within which the given
- time is located, i.e.:
- age_merger[idx-1] >= t > age_merger[idx]
- """
- return (self.age_merger > t).sum()
-
- def _merger_time(self, t):
- """
- Determine the beginning time of the merger event within which
- the given time is located.
- """
- idx = self._merger_idx(t)
- return self.age_merger[idx]
-
def _merger_event(self, t):
"""
- Return the merger event at cosmic time ``t``.
+ Return the most recent merger event happend before the given time,
+ i.e., the merger event that the given time locates in.
"""
- idx = self._merger_idx(t)
+ idx = (self.age_merger > t).sum()
return {
"idx": idx,
"M_main": self.M_main[idx],
@@ -803,6 +788,14 @@ class RadioHaloAM(RadioHalo1M):
"age": self.age_merger[idx],
}
+ def _merger_time(self, t):
+ """
+ Determine the beginning time of the merger event within which
+ the given time is located.
+ """
+ merger = self._merger_event(t)
+ return merger["age"]
+
def mass_merged(self, t):
"""
The mass of merged cluster at the given (cosmic) time.