From b4bd6c891ad3d03e0b3c59af19b1fca4f76c2015 Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Thu, 21 Feb 2019 17:55:27 +0800 Subject: clusters/halo: Add 't_merger_end' property --- fg21sim/extragalactic/clusters/halo.py | 39 ++++++++++++++++++++++++++-------- 1 file changed, 30 insertions(+), 9 deletions(-) (limited to 'fg21sim/extragalactic/clusters/halo.py') 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 @@ -206,6 +206,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): """ @@ -774,12 +784,31 @@ 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): """ @@ -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, -- cgit v1.2.2