From 5b3c99ad46b6fd141ea1aa30d9e436ee564d04e8 Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Sat, 26 Jan 2019 15:51:27 +0800 Subject: clusters/halo: Use t_merger for duration_turb() and mach_turb() Rename mach_turbulence() to mach_turb(). --- fg21sim/extragalactic/clusters/halo.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/fg21sim/extragalactic/clusters/halo.py b/fg21sim/extragalactic/clusters/halo.py index b480b9c..ed73a47 100644 --- a/fg21sim/extragalactic/clusters/halo.py +++ b/fg21sim/extragalactic/clusters/halo.py @@ -197,7 +197,8 @@ class RadioHalo1M: """ return self.age_merger - def duration_turb(self, t=None): + @lru_cache() + def duration_turb(self, t_merger): """ The duration that the turbulence persists strong enough to be able to effectively accelerate the electrons, which is @@ -208,7 +209,7 @@ class RadioHalo1M: Unit: [Gyr] """ - t_merger = self._merger_time(t) + self._validate_t_merger(t_merger) z_merger = COSMO.redshift(t_merger) M_main = self.mass_main(t=t_merger) M_sub = self.mass_sub(t=t_merger) @@ -217,11 +218,12 @@ class RadioHalo1M: uconv = AUC.kpc2km * AUC.s2Gyr # [kpc]/[km/s] => [Gyr] return uconv * 2*L_turb / vi # [Gyr] - def mach_turbulence(self, t=None): + @lru_cache() + def mach_turb(self, t_merger): """ The turbulence Mach number determined from its velocity dispersion. """ - t_merger = self._merger_time(t) + self._validate_t_merger(t_merger) cs = helper.speed_sound(self.kT(t_merger)) # [km/s] v_turb = self._velocity_turb(t_merger) # [km/s] return v_turb / cs -- cgit v1.2.2