From c982158603c0fdad37fb8b0eb596eeba28470b83 Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Mon, 28 Jan 2019 10:30:57 +0800 Subject: clusters/halo: calc_acc_factor() accepts the fiducial spectrum --- fg21sim/extragalactic/clusters/halo.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'fg21sim/extragalactic') diff --git a/fg21sim/extragalactic/clusters/halo.py b/fg21sim/extragalactic/clusters/halo.py index 5fd00f7..6cde5ca 100644 --- a/fg21sim/extragalactic/clusters/halo.py +++ b/fg21sim/extragalactic/clusters/halo.py @@ -488,7 +488,7 @@ class RadioHalo1M: return n_e - def calc_acc_factor(self, n_e): + def calc_acc_factor(self, n_e, n_e_fiducial=None): """ Calculate the turbulence acceleration factor, which is estimated as the ratio of the bolometric emissivity between the accelerated @@ -500,6 +500,9 @@ class RadioHalo1M: n_e : float 1D `~numpy.ndarray` The derived (accelerated) electron spectrum. Unit: [cm^-3] + n_e_fiducial : float 1D `~numpy.ndarray`, optional + The fiducial electron spectrum. + Unit: [cm^-3] Returns ------- @@ -509,8 +512,9 @@ class RadioHalo1M: haloem = HaloEmission(gamma=self.gamma, n_e=n_e, B=1) em = haloem.calc_emissivity_bolo() - ne_fiducial = self.calc_electron_spectrum(fiducial=True) - haloem.n_e = ne_fiducial + if n_e_fiducial is None: + n_e_fiducial = self.calc_electron_spectrum(fiducial=True) + haloem.n_e = n_e_fiducial em_fiducial = haloem.calc_emissivity_bolo() return em / em_fiducial -- cgit v1.2.2