From 3760624fc4a35a81d0d22c22c26282657826126c Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Thu, 1 Nov 2018 23:48:08 +0800 Subject: clusters/halo: Improve cluster temperature calculation --- fg21sim/extragalactic/clusters/halo.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'fg21sim/extragalactic/clusters') diff --git a/fg21sim/extragalactic/clusters/halo.py b/fg21sim/extragalactic/clusters/halo.py index 0db0b0d..7343cb1 100644 --- a/fg21sim/extragalactic/clusters/halo.py +++ b/fg21sim/extragalactic/clusters/halo.py @@ -290,18 +290,16 @@ class RadioHalo: return helper.kT_cluster(self.M_obs, z=self.z_obs, configs=self.configs) - def kT(self, t=None): + @lru_cache() + def kT(self, t): """ - The ICM mean temperature of the main cluster at cosmic time - ``t`` (default: ``self.age_begin``). - + The ICM mean temperature of the merged cluster. Unit: [keV] """ - if t is None: - t = self.age_begin - mass = self.mass_main(t) + M_main = self.mass_main(t) + M_sub = self.mass_sub(t) z = COSMO.redshift(t) - return helper.kT_cluster(mass=mass, z=z, configs=self.configs) + return helper.kT_cluster(mass=M_main+M_sub, z=z, configs=self.configs) def tau_acceleration(self, t): """ -- cgit v1.2.2