diff options
author | Aaron LI <aly@aaronly.me> | 2018-10-31 13:47:51 +0800 |
---|---|---|
committer | Aaron LI <aly@aaronly.me> | 2018-10-31 13:50:33 +0800 |
commit | 5392586716a35d98633c2d7e4be542d43489a173 (patch) | |
tree | a5cdb7e501524036bd97af6aaff69de57fd9d42b /fg21sim/extragalactic/clusters/halo.py | |
parent | 16f4206a5b92c9a1394b24d8487bd33bae898e6d (diff) | |
download | fg21sim-5392586716a35d98633c2d7e4be542d43489a173.tar.bz2 |
clusters/halo: Add time argument to _gas_density_profile_t()
Diffstat (limited to 'fg21sim/extragalactic/clusters/halo.py')
-rw-r--r-- | fg21sim/extragalactic/clusters/halo.py | 10 |
1 files changed, 6 insertions, 4 deletions
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 |