aboutsummaryrefslogtreecommitdiffstats
path: root/fg21sim/extragalactic
diff options
context:
space:
mode:
authorAaron LI <aly@aaronly.me>2017-10-25 18:11:46 +0800
committerAaron LI <aly@aaronly.me>2017-10-25 18:11:46 +0800
commit8eb88489c97053da941986b97bc68984bbe4b428 (patch)
treecd225687640770c860ee02f46da133d82b063b71 /fg21sim/extragalactic
parentbd8b01302d77df4a74da4e8374f0e32a8ec2598b (diff)
downloadfg21sim-8eb88489c97053da941986b97bc68984bbe4b428.tar.bz2
clusters/halo: Fix fp_advection() w.r.t. initial electron spectrum calc.
Diffstat (limited to 'fg21sim/extragalactic')
-rw-r--r--fg21sim/extragalactic/clusters/halo.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/fg21sim/extragalactic/clusters/halo.py b/fg21sim/extragalactic/clusters/halo.py
index d543dcc..281093d 100644
--- a/fg21sim/extragalactic/clusters/halo.py
+++ b/fg21sim/extragalactic/clusters/halo.py
@@ -404,7 +404,7 @@ class RadioHalo:
"""
# Accumulated electrons constantly injected until ``age_merger``
n_inj = self.fp_injection(self.gamma)
- n0_e = n_inj * self.age_merger
+ n0_e = n_inj * (self.age_merger - self.time_init)
logger.debug("Derive the initial electron spectrum ...")
# NOTE: subtract ``time_step`` to avoid the acceleration at the
@@ -760,7 +760,9 @@ class RadioHalo:
# Always use the properties at ``age_merger`` to derive the
# initial electron spectrum.
if t < self.age_merger:
- t = self.age_merger
+ # NOTE: subtract ``time_step`` to make sure ``fp_diffusion()``
+ # gives no acceleration.
+ t = self.age_merger - self.time_step
gamma = np.asarray(gamma)
advection = (abs(self._loss_ion(gamma, t)) +