aboutsummaryrefslogtreecommitdiffstats
path: root/fg21sim
diff options
context:
space:
mode:
authorAaron LI <aly@aaronly.me>2018-10-31 13:47:51 +0800
committerAaron LI <aly@aaronly.me>2018-10-31 13:50:33 +0800
commit5392586716a35d98633c2d7e4be542d43489a173 (patch)
treea5cdb7e501524036bd97af6aaff69de57fd9d42b /fg21sim
parent16f4206a5b92c9a1394b24d8487bd33bae898e6d (diff)
downloadfg21sim-5392586716a35d98633c2d7e4be542d43489a173.tar.bz2
clusters/halo: Add time argument to _gas_density_profile_t()
Diffstat (limited to 'fg21sim')
-rw-r--r--fg21sim/extragalactic/clusters/halo.py10
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