From ba769e231159def35a05950278b50fe8a61b77b3 Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Wed, 31 Oct 2018 15:43:20 +0800 Subject: clusters/halo: Use _is_turb_active() in fp_advection() Some other minor cleanups. --- fg21sim/extragalactic/clusters/halo.py | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) (limited to 'fg21sim') diff --git a/fg21sim/extragalactic/clusters/halo.py b/fg21sim/extragalactic/clusters/halo.py index 86f85ba..c54bb73 100644 --- a/fg21sim/extragalactic/clusters/halo.py +++ b/fg21sim/extragalactic/clusters/halo.py @@ -227,9 +227,7 @@ class RadioHalo: @property def radius_virial_obs(self): """ - The virial radius of the "current" cluster (``M_obs``) at - ``z_obs``. - + The virial radius of the "current" cluster (``M_obs``) at ``z_obs``. Unit: [kpc] """ return helper.radius_virial(mass=self.M_obs, z=self.z_obs) @@ -586,16 +584,16 @@ class RadioHalo: Returns ------- advection : float, or float 1D `~numpy.ndarray` - Advection coefficients, describing the energy loss/gain rates. + Advection coefficient. Unit: [Gyr^-1] """ - if t < self.age_begin: - # To derive the initial electron spectrum - advection = abs(self._energy_loss(gamma, self.age_begin)) - else: + if self._is_turb_active(t): # Turbulence acceleration and beyond advection = (abs(self._energy_loss(gamma, t)) - (self.fp_diffusion(gamma, t) * 2 / gamma)) + else: + # To derive the initial electron spectrum + advection = abs(self._energy_loss(gamma, self.age_begin)) return advection def _merger_time(self, t=None): @@ -630,12 +628,6 @@ class RadioHalo: So we assume that the main cluster grows linearly in time from (M_main, z_merger) to (M_obs, z_obs). - Parameters - ---------- - t : float - The (cosmic) time/age. - Unit: [Gyr] - Returns ------- mass : float -- cgit v1.2.2