aboutsummaryrefslogtreecommitdiffstats
path: root/fg21sim
diff options
context:
space:
mode:
authorAaron LI <aly@aaronly.me>2019-02-21 17:55:27 +0800
committerAaron LI <aly@aaronly.me>2019-02-21 17:55:27 +0800
commitb4bd6c891ad3d03e0b3c59af19b1fca4f76c2015 (patch)
treee69f2d241097367ca8890c130cb85cb078a0eb3f /fg21sim
parenta509266bf3ebdaf85d77b30fdc77d31ced442774 (diff)
downloadfg21sim-b4bd6c891ad3d03e0b3c59af19b1fca4f76c2015.tar.bz2
clusters/halo: Add 't_merger_end' property
Diffstat (limited to 'fg21sim')
-rw-r--r--fg21sim/extragalactic/clusters/halo.py39
1 files changed, 30 insertions, 9 deletions
diff --git a/fg21sim/extragalactic/clusters/halo.py b/fg21sim/extragalactic/clusters/halo.py
index cc90c7a..151dbab 100644
--- a/fg21sim/extragalactic/clusters/halo.py
+++ b/fg21sim/extragalactic/clusters/halo.py
@@ -207,6 +207,16 @@ class RadioHalo1M:
return self.t_merger
@property
+ @lru_cache()
+ def t_merger_end(self):
+ """
+ The time when the merger/turbulence ends.
+ Unit: [Gyr]
+ """
+ tau_turb = self.duration_turb(self.t_merger)
+ return self.t_merger + tau_turb
+
+ @property
def radius(self):
"""
The estimated radius of the simulated radio halo.
@@ -774,13 +784,32 @@ class RadioHaloAM(RadioHalo1M):
merger_num, configs=CONFIGS):
M_main = np.asarray(M_main[:merger_num])
M_sub = np.asarray(M_sub[:merger_num])
- z_merger = np.asarray(z_merger[:merger_num])
+ z_merger = np.asarray(z_merger[:merger_num]) # increasing
super().__init__(M_obs=M_obs, z_obs=z_obs,
M_main=M_main, M_sub=M_sub,
z_merger=z_merger, configs=configs)
self.merger_num = merger_num
@property
+ def t_begin(self):
+ """
+ The cosmic time when the first merger begins.
+ Unit: [Gyr]
+ """
+ return self.t_merger[-1]
+
+ @property
+ @lru_cache()
+ def t_merger_end(self):
+ """
+ The times when the mergers (i.e., turbulence) end.
+ (NOTE: decreasing order)
+
+ Unit: [Gyr]
+ """
+ return np.array([t+self.duration_turb(t) for t in self.t_merger])
+
+ @property
def radius(self):
"""
The halo radius estimated by using the maximum turbulence radius.
@@ -827,14 +856,6 @@ class RadioHaloAM(RadioHalo1M):
return r_eff
- @property
- def t_begin(self):
- """
- The cosmic time when the merger begins, i.e., the earliest merger.
- Unit: [Gyr]
- """
- return self.t_merger[-1]
-
def _merger_event(self, t):
"""
Return the most recent merger event happend before the given time,