From 8eb88489c97053da941986b97bc68984bbe4b428 Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Wed, 25 Oct 2017 18:11:46 +0800 Subject: clusters/halo: Fix fp_advection() w.r.t. initial electron spectrum calc. --- fg21sim/extragalactic/clusters/halo.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'fg21sim/extragalactic') 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)) + -- cgit v1.2.2