diff options
author | Aaron LI <aly@aaronly.me> | 2017-07-26 17:22:19 +0800 |
---|---|---|
committer | Aaron LI <aly@aaronly.me> | 2017-07-26 17:22:19 +0800 |
commit | aa83d8d572b56fa5cd4e2257df120caf7734efac (patch) | |
tree | 995a861e836d0c5166c4273f42c179ae7858fff4 /fg21sim/extragalactic | |
parent | 43d05744123aee58ac8fad8dc778657c102630ec (diff) | |
download | fg21sim-aa83d8d572b56fa5cd4e2257df120caf7734efac.tar.bz2 |
clusters/emission.py: Fix the calling to F(x)
Signed-off-by: Aaron LI <aly@aaronly.me>
Diffstat (limited to 'fg21sim/extragalactic')
-rw-r--r-- | fg21sim/extragalactic/clusters/emission.py | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/fg21sim/extragalactic/clusters/emission.py b/fg21sim/extragalactic/clusters/emission.py index b17c00b..15ef309 100644 --- a/fg21sim/extragalactic/clusters/emission.py +++ b/fg21sim/extragalactic/clusters/emission.py @@ -80,21 +80,20 @@ class SynchrotronEmission: Parameters ---------- - gamma : float, or `~numpy.ndarray` + gamma : `~numpy.ndarray` Electron Lorentz factors γ - theta : float, or `~numpy.ndarray`, optional + theta : `~numpy.ndarray`, optional The angles between the electron velocity and the magnetic field. Unit: [rad] Returns ------- - nu : float, or `~numpy.ndarray` + nu_c : `~numpy.ndarray` Critical frequencies Unit: [MHz] """ - nu_L = self.frequency_larmor - nu = (3/2) * gamma**2 * np.sin(theta) * nu_L - return nu + nu_c = 1.5 * gamma**2 * np.sin(theta) * self.frequency_larmor + return nu_c @staticmethod def F(x): @@ -169,9 +168,7 @@ class SynchrotronEmission: theta = np.linspace(0, np.pi/2, num=len(self.gamma))[1:] theta_grid, gamma_grid = np.meshgrid(theta, self.gamma) nu_c = self.frequency_crit(gamma_grid, theta_grid) - Fv = np.vectorize(self.F, otypes=[np.float]) - x = nu / nu_c - kernel = Fv(x) + kernel = self.F(nu / nu_c) # 2D samples over width to do the integration s2d = kernel * np.outer(self.n_e, np.sin(theta)**2) |