From 3508da9c0d3cd179c84e193c632df732a6ab6404 Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Fri, 5 Jan 2018 15:44:47 +0800 Subject: clusters/halo: add _merger_time() and mass_sub() methods --- fg21sim/extragalactic/clusters/halo.py | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'fg21sim/extragalactic') diff --git a/fg21sim/extragalactic/clusters/halo.py b/fg21sim/extragalactic/clusters/halo.py index f8902a3..1f9e6b2 100644 --- a/fg21sim/extragalactic/clusters/halo.py +++ b/fg21sim/extragalactic/clusters/halo.py @@ -600,6 +600,13 @@ class RadioHalo: (self.fp_diffusion(gamma, t) * 2 / gamma)) return advection + def _merger_time(self, t=None): + """ + The (cosmic) time when the merger begins. + Unit: [Gyr] + """ + return self.age_begin + def mass_merged(self, t=None): """ The mass of the merged cluster. @@ -607,6 +614,13 @@ class RadioHalo: """ return self.M_main + self.M_sub + def mass_sub(self, t=None): + """ + The mass of the sub cluster. + Unit: [Msun] + """ + return self.M_sub + def mass_main(self, t): """ Calculate the main cluster mass at the given (cosmic) time. @@ -785,6 +799,14 @@ class RadioHaloAM(RadioHalo): """ 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(self, idx): """ Return the properties of the idx-th merger event. @@ -808,6 +830,15 @@ class RadioHaloAM(RadioHalo): merger = self._merger(idx) return (merger["M_main"] + merger["M_sub"]) + def mass_sub(self, t): + """ + The mass of the sub cluster at the given (cosmic) time. + Unit: [Msun] + """ + idx = self._merger_idx(t) + merger = self._merger(idx) + return merger["M_sub"] + def mass_main(self, t): """ Calculate the main cluster mass at the given (cosmic) time. -- cgit v1.2.2