diff options
author | Aaron LI <aly@aaronly.me> | 2018-10-31 15:43:20 +0800 |
---|---|---|
committer | Aaron LI <aly@aaronly.me> | 2018-10-31 15:43:20 +0800 |
commit | ba769e231159def35a05950278b50fe8a61b77b3 (patch) | |
tree | b7fcf85f1e4e2d021e9d23b0e9427c80f52b942f /fg21sim | |
parent | 10a397d6995a7192844fb9478b84fb9b1fa19134 (diff) | |
download | fg21sim-ba769e231159def35a05950278b50fe8a61b77b3.tar.bz2 |
clusters/halo: Use _is_turb_active() in fp_advection()
Some other minor cleanups.
Diffstat (limited to 'fg21sim')
-rw-r--r-- | fg21sim/extragalactic/clusters/halo.py | 20 |
1 files changed, 6 insertions, 14 deletions
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 |