aboutsummaryrefslogtreecommitdiffstats
path: root/fg21sim/extragalactic/clusters
diff options
context:
space:
mode:
authorAaron LI <aly@aaronly.me>2019-02-21 20:52:44 +0800
committerAaron LI <aly@aaronly.me>2019-02-21 20:52:44 +0800
commit8e563e91d8b0dc239e124fb7e88d84c1c8506b67 (patch)
tree9783aa8cbf3c7362d417b4921b3d41f1eacd8c79 /fg21sim/extragalactic/clusters
parent157028160de3a7baa640cbe87bf5f1a3c1b90ad7 (diff)
downloadfg21sim-8e563e91d8b0dc239e124fb7e88d84c1c8506b67.tar.bz2
clusters/halo: Implement _merger_end_time() method
Determine the ending time of the most recent merger happened before the given time.
Diffstat (limited to 'fg21sim/extragalactic/clusters')
-rw-r--r--fg21sim/extragalactic/clusters/halo.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/fg21sim/extragalactic/clusters/halo.py b/fg21sim/extragalactic/clusters/halo.py
index eb873ec..5eda8da 100644
--- a/fg21sim/extragalactic/clusters/halo.py
+++ b/fg21sim/extragalactic/clusters/halo.py
@@ -672,6 +672,13 @@ class RadioHalo1M:
"""
return self.t_merger
+ def _merger_end_time(self, t=None):
+ """
+ The (cosmic) time when the merger ends.
+ Unit: [Gyr]
+ """
+ return self.t_merger_end
+
def _validate_time(self, t, include_end=True):
"""
Validate that the given time ``t`` is the time when a merger begins
@@ -921,6 +928,17 @@ class RadioHaloAM(RadioHalo1M):
m = self._merger_event(t)
return m["t"]
+ def _merger_end_time(self, t):
+ """
+ Determine the ending time of the most recent merger happened before
+ the given time.
+
+ Unit: [Gyr]
+ """
+ t_end = np.sort(self.t_merger_end) # increasing order
+ idx = (t_end <= t).sum() - 1
+ return t_end[idx]
+
@property
@lru_cache()
def _time_adjust(self):