diff options
author | Aaron LI <aly@aaronly.me> | 2017-10-24 15:52:28 +0800 |
---|---|---|
committer | Aaron LI <aly@aaronly.me> | 2017-10-24 15:52:28 +0800 |
commit | fc0d1b1400f3a43dad9ebffa731889ca7261f243 (patch) | |
tree | 47df0c0ee1c91667406989523dc6fedb2b1a04cc /fg21sim/extragalactic/clusters/halo.py | |
parent | c15cb0c93eb931deb0c98d351367a7218b9465ea (diff) | |
download | fg21sim-fc0d1b1400f3a43dad9ebffa731889ca7261f243.tar.bz2 |
clusters/halo: Allow specify magnetic field in calc_emissivity()
Diffstat (limited to 'fg21sim/extragalactic/clusters/halo.py')
-rw-r--r-- | fg21sim/extragalactic/clusters/halo.py | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/fg21sim/extragalactic/clusters/halo.py b/fg21sim/extragalactic/clusters/halo.py index 62bb011..8ef6640 100644 --- a/fg21sim/extragalactic/clusters/halo.py +++ b/fg21sim/extragalactic/clusters/halo.py @@ -446,7 +446,7 @@ class RadioHalo: else: raise ValueError("given electron spectrum has wrong shape!") - def calc_emissivity(self, frequencies, n_e=None, gamma=None): + def calc_emissivity(self, frequencies, n_e=None, gamma=None, B=None): """ Calculate the synchrotron emissivity for the derived electron spectrum. @@ -458,12 +458,16 @@ class RadioHalo: Unit: [MHz] n_e : 1D `~numpy.ndarray`, optional The electron spectrum (w.r.t. Lorentz factors γ). - If not provided, then used the cached ``self.electron_spec`` - solved above. + If not provided, then use the cached ``self.electron_spec`` + that was solved at above. Unit: [cm^-3] gamma : 1D `~numpy.ndarray`, optional The Lorentz factors γ of the electron spectrum. - If not provided, then used ``self.gamma``. + If not provided, then use ``self.gamma``. + B : float, optional + The magnetic field strength. + If not provided, then use ``self.magnetic_field``. + Unit: [uG] Returns ------- @@ -476,8 +480,9 @@ class RadioHalo: n_e = self.electron_spec if gamma is None: gamma = self.gamma - syncem = SynchrotronEmission(gamma=gamma, n_e=n_e, - B=self.magnetic_field) + if B is None: + B = self.magnetic_field + syncem = SynchrotronEmission(gamma=gamma, n_e=n_e, B=B) emissivity = syncem.emissivity(frequencies) return emissivity @@ -503,7 +508,7 @@ class RadioHalo: If not provided, then invoke above ``calc_emissivity()`` method to calculate them. Unit: [erg/s/cm^3/Hz] - **kwargs : optional arguments, i.e., ``n_e`` and ``gamma`` + **kwargs : optional arguments, i.e., ``n_e``, ``gamma``, and ``B``. Returns ------- @@ -549,7 +554,7 @@ class RadioHalo: frequencies : float, or 1D `~numpy.ndarray` The frequencies where to calculate the flux density. Unit: [MHz] - **kwargs : optional arguments, i.e., ``n_e`` and ``gamma`` + **kwargs : optional arguments, i.e., ``n_e``, ``gamma``, and ``B``. Returns ------- @@ -589,7 +594,7 @@ class RadioHalo: If not provided, then invoke above ``calc_flux()`` method to calculate them. Unit: [arcsec] - **kwargs : optional arguments, i.e., ``n_e`` and ``gamma`` + **kwargs : optional arguments, i.e., ``n_e``, ``gamma``, and ``B``. Returns ------- |