From 5392586716a35d98633c2d7e4be542d43489a173 Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Wed, 31 Oct 2018 13:47:51 +0800 Subject: clusters/halo: Add time argument to _gas_density_profile_t() --- fg21sim/extragalactic/clusters/halo.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'fg21sim') diff --git a/fg21sim/extragalactic/clusters/halo.py b/fg21sim/extragalactic/clusters/halo.py index 07d0a9f..151e5c8 100644 --- a/fg21sim/extragalactic/clusters/halo.py +++ b/fg21sim/extragalactic/clusters/halo.py @@ -665,9 +665,8 @@ class RadioHalo: B = helper.magnetic_field(mass=mass, z=z, configs=self.configs) return B - @property @lru_cache() - def _gas_density_profile_f(self): + def _gas_density_profile_f(self, t=None): """ The gas density profile of the merged cluster. @@ -676,8 +675,11 @@ class RadioHalo: f(r) : function A function that calculates the gas density of unit [Msun/kpc^3]. """ - return helper.calc_gas_density_profile( - mass=self.M_main+self.M_sub, z=self.z_merger) + M_main = self.mass_main(t) + M_sub = self.mass_sub(t) + t_merger = self._merger_time(t) + z_merger = COSMO.redshift(t_merger) + return helper.calc_gas_density_profile(mass=M_main+M_sub, z=z_merger) @property @lru_cache -- cgit v1.2.2