aboutsummaryrefslogtreecommitdiffstats
path: root/fg21sim
diff options
context:
space:
mode:
authorAaron LI <aly@aaronly.me>2019-01-27 21:00:51 +0800
committerAaron LI <aly@aaronly.me>2019-01-27 21:10:56 +0800
commit590d32543e36f88afb195d1128895e5f2de81bd3 (patch)
tree6e5b76e7e4c6147a3bb9d81a1863cbd04d89b59a /fg21sim
parente9a2f7f735abff5b1d537f0fd6fe1eba467a79ee (diff)
downloadfg21sim-590d32543e36f88afb195d1128895e5f2de81bd3.tar.bz2
clusters/halo: Fix minor errors along the refactoring
Diffstat (limited to 'fg21sim')
-rw-r--r--fg21sim/extragalactic/clusters/halo.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/fg21sim/extragalactic/clusters/halo.py b/fg21sim/extragalactic/clusters/halo.py
index 7067330..5fd00f7 100644
--- a/fg21sim/extragalactic/clusters/halo.py
+++ b/fg21sim/extragalactic/clusters/halo.py
@@ -358,15 +358,14 @@ class RadioHalo1M:
"""
self._validate_t_merger(t_merger)
- L = 2 * self.radius_turb(t_merger) # [kpc]
- k_L = 2 * np.pi / L_turb
+ k_L = 2 * np.pi / self.radius_turb(t_merger) # [kpc^-1]
cs = helper.speed_sound(self.kT(t_merger)) # [km/s]
v_t = self.velocity_turb(t_merger) # [km/s]
tau = self.x_cr * cs**3 / (8*k_L * v_t**4)
tau *= AUC.s2Gyr * AUC.kpc2km # [s kpc/km] -> [Gyr]
# Mass scaling
- M_main = self.mass_main(t)
+ M_main = self.mass_main(t_merger)
f_mass = (M_main / 1e15) ** (-self.mass_index)
tau *= f_mass
tau /= self.f_acc # tune factor (folded with "zeta_ins")
@@ -745,7 +744,7 @@ class RadioHaloAM(RadioHalo1M):
Number of merger events traced for the cluster.
"""
def __init__(self, M_obs, z_obs, M_main, M_sub, z_merger,
- merger_num, radius, configs=CONFIGS):
+ merger_num, configs=CONFIGS):
M_main = np.asarray(M_main[:merger_num])
M_sub = np.asarray(M_sub[:merger_num])
z_merger = np.asarray(z_merger[:merger_num])
@@ -986,7 +985,7 @@ class RadioHaloAM(RadioHalo1M):
return n_e
logger.debug("Calculating the electron spectrum ...")
- tps = [self.t_begin] + self._time_adjust + [self.t_obs]
+ tps = [self.t_begin] + self._time_adjust() + [self.t_obs]
n1_e = n0_e
for t1, t2 in zip(tps, tps[1:]):
if tstart >= t2 or tstop < t1: