aboutsummaryrefslogtreecommitdiffstats
path: root/fg21sim/extragalactic/clusters/halo.py
diff options
context:
space:
mode:
authorAaron LI <aly@aaronly.me>2019-01-26 15:25:54 +0800
committerAaron LI <aly@aaronly.me>2019-01-26 15:28:13 +0800
commitf6331e3f8548eed6579ad3ed869003a4cb4f8f7a (patch)
tree06c055769f92fad15c4595913658f10aa33cdce0 /fg21sim/extragalactic/clusters/halo.py
parent230c54b44958dbef49c0300d7479576c45e057c5 (diff)
downloadfg21sim-f6331e3f8548eed6579ad3ed869003a4cb4f8f7a.tar.bz2
clusters/halo: Some cleanups
Diffstat (limited to 'fg21sim/extragalactic/clusters/halo.py')
-rw-r--r--fg21sim/extragalactic/clusters/halo.py43
1 files changed, 15 insertions, 28 deletions
diff --git a/fg21sim/extragalactic/clusters/halo.py b/fg21sim/extragalactic/clusters/halo.py
index 706426e..ed05edf 100644
--- a/fg21sim/extragalactic/clusters/halo.py
+++ b/fg21sim/extragalactic/clusters/halo.py
@@ -256,24 +256,6 @@ class RadioHalo1M:
return helper.radius_stripping(M_main, M_sub, z,
f_rc=self.f_rc, beta=self.beta)
- def calc_radius(self):
- """
- The estimated radius of the simulated radio halo.
- Unit: [kpc]
- """
- return self.radius_turbulence(self.age_merger) * self.f_radius
-
- @lru_cache()
- def kT(self, t):
- """
- The ICM mean temperature of the main cluster.
- Unit: [keV]
- """
- kT_out = self.configs.getn("extragalactic/clusters/kT_out")
- M_main = self.mass_main(t)
- z = COSMO.redshift(t)
- return helper.kT_cluster(mass=M_main, z=z, kT_out=kT_out)
-
def tau_acceleration(self, t):
"""
Calculate the electron acceleration timescale due to turbulent
@@ -636,20 +618,26 @@ class RadioHalo1M:
def mass_main(self, t):
"""
Calculate the main cluster mass at the given (cosmic) time.
- Unit: [Msun]
-
- NOTE
- ----
- Since we currently only consider the last major merger event,
- there may be a long time between ``z_merger`` and ``z_obs``.
- So we assume that the main cluster grows linearly in time from
+ The main cluster is assumed to grow linearly in time from
(M_main, z_merger) to (M_obs, z_obs).
+
+ Unit: [Msun]
"""
t0 = self.age_begin
rate = (self.M_obs - self.M_main) / (self.age_obs - t0)
mass = rate * (t - t0) + self.M_main # [Msun]
return mass
+ def kT(self, t):
+ """
+ The ICM mean temperature of the main cluster.
+ Unit: [keV]
+ """
+ kT_out = self.configs.getn("extragalactic/clusters/kT_out")
+ M_main = self.mass_main(t)
+ z = COSMO.redshift(t)
+ return helper.kT_cluster(mass=M_main, z=z, kT_out=kT_out)
+
def magnetic_field(self, t):
"""
Calculate the mean magnetic field strength of the main cluster mass
@@ -713,7 +701,6 @@ class RadioHalo1M:
rho_main = helper.density_number_thermal(M_main, z) # [cm^-3]
rho_main *= AC.mu*AC.u * AUC.g2Msun * AUC.kpc2cm**3 # [Msun/kpc^3]
R_vir = helper.radius_virial(M_main, z) # [kpc]
- r_s = self.radius_stripping(t) # [kpc]
V_turb = np.pi * r_s**2 * (R_vir+r_s) # [kpc^3]
E_turb = self.eta_turb * rho_main * v_i**2 * V_turb
@@ -1020,8 +1007,8 @@ class RadioHalo:
halos.sort(key=lambda h: h["radius_turb"], reverse=True)
for hdict in halos:
halo = hdict["halo"]
- logger.info("Checking merger: %.2e & %.2e @ %.3f ..." %
- (halo.M_main, halo.M_sub, halo.z_merger))
+ logger.info("Checking merger: %.2e & %.2e @ %.3f -> %.3f ..." %
+ (halo.M_main, halo.M_sub, halo.z_merger, halo.z_obs))
n_e = halo.calc_electron_spectrum()
genuine, em_factor = halo.is_genuine(n_e)
hdict["n_e"] = n_e