diff options
| author | Aaron LI <aly@aaronly.me> | 2019-02-21 20:17:47 +0800 | 
|---|---|---|
| committer | Aaron LI <aly@aaronly.me> | 2019-02-21 20:17:47 +0800 | 
| commit | 308442d1ca1a0f56889dd60f78d2b776ace2d81b (patch) | |
| tree | fab595f754fa50ae84e50e08d37da71bd6cc2991 /fg21sim | |
| parent | 4b87e5e6af2e45b08e4cb7d36c54ba560f9517e2 (diff) | |
| download | fg21sim-308442d1ca1a0f56889dd60f78d2b776ace2d81b.tar.bz2 | |
clusters/halo: Reorder the '_energy_loss()' method
Diffstat (limited to 'fg21sim')
| -rw-r--r-- | fg21sim/extragalactic/clusters/halo.py | 54 | 
1 files changed, 21 insertions, 33 deletions
| diff --git a/fg21sim/extragalactic/clusters/halo.py b/fg21sim/extragalactic/clusters/halo.py index 55c7ca0..e24a0c3 100644 --- a/fg21sim/extragalactic/clusters/halo.py +++ b/fg21sim/extragalactic/clusters/halo.py @@ -645,6 +645,27 @@ class RadioHalo1M:                       (self.fp_diffusion(gamma, t) * 2 / gamma))          return advection +    def _energy_loss(self, gamma, t): +        """ +        Energy loss mechanisms: +        * inverse Compton scattering off the CMB photons +        * synchrotron radiation +        * Coulomb collisions + +        Reference: Ref.[sarazin1999],Eqs.(6,7,9) + +        Unit: [Gyr^-1] +        """ +        gamma = np.asarray(gamma) +        z = COSMO.redshift(t) +        B = self.magnetic_field(t)  # [uG] +        mass = self.mass_main(t) +        n_th = helper.density_number_thermal(mass, z)  # [cm^-3] +        loss_ic = -4.32e-4 * gamma**2 * (1+z)**4 +        loss_syn = -4.10e-5 * gamma**2 * B**2 +        loss_coul = -3.79e4 * n_th * (1 + np.log(gamma/n_th) / 75) +        return loss_ic + loss_syn + loss_coul +      def _merger_time(self, t=None):          """          The (cosmic) time when the merger begins. @@ -723,39 +744,6 @@ class RadioHalo1M:          tau_turb = self.duration_turb(t_merger)          return (t >= t_merger) and (t <= t_merger + tau_turb) -    def _energy_loss(self, gamma, t): -        """ -        Energy loss mechanisms: -        * inverse Compton scattering off the CMB photons -        * synchrotron radiation -        * Coulomb collisions - -        Reference: Ref.[sarazin1999],Eqs.(6,7,9) - -        Parameters -        ---------- -        gamma : float, or float 1D `~numpy.ndarray` -            The Lorentz factors of electrons -        t : float -            The cosmic time/age -            Unit: [Gyr] - -        Returns -        ------- -        loss : float, or float 1D `~numpy.ndarray` -            The energy loss rates -            Unit: [Gyr^-1] -        """ -        gamma = np.asarray(gamma) -        z = COSMO.redshift(t) -        B = self.magnetic_field(t)  # [uG] -        mass = self.mass_main(t) -        n_th = helper.density_number_thermal(mass, z)  # [cm^-3] -        loss_ic = -4.32e-4 * gamma**2 * (1+z)**4 -        loss_syn = -4.10e-5 * gamma**2 * B**2 -        loss_coul = -3.79e4 * n_th * (1 + np.log(gamma/n_th) / 75) -        return loss_ic + loss_syn + loss_coul -  class RadioHaloAM(RadioHalo1M):      """ | 
