aboutsummaryrefslogtreecommitdiffstats
path: root/fg21sim/extragalactic/clusters/emission.py
diff options
context:
space:
mode:
authorAaron LI <aly@aaronly.me>2017-07-21 10:40:37 +0800
committerAaron LI <aly@aaronly.me>2017-07-21 14:52:21 +0800
commit7b8215c64581af20249f092287e2152315e3b566 (patch)
tree824e7a9b3cca218ae44f0ac3d1b6b026c568132f /fg21sim/extragalactic/clusters/emission.py
parentd31eec7033f8a511a450f966b35866ed7570f8fb (diff)
downloadfg21sim-7b8215c64581af20249f092287e2152315e3b566.tar.bz2
Use the global "cosmo" instance for simplification
Signed-off-by: Aaron LI <aly@aaronly.me>
Diffstat (limited to 'fg21sim/extragalactic/clusters/emission.py')
-rw-r--r--fg21sim/extragalactic/clusters/emission.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/fg21sim/extragalactic/clusters/emission.py b/fg21sim/extragalactic/clusters/emission.py
index 93e04ff..4366025 100644
--- a/fg21sim/extragalactic/clusters/emission.py
+++ b/fg21sim/extragalactic/clusters/emission.py
@@ -18,11 +18,11 @@ import numpy as np
import scipy.integrate
import scipy.special
+from ...utils import cosmo
from ...utils.units import (Units as AU,
UnitConversions as AUC,
Constants as AC)
from ...utils.convert import Fnu_to_Tb_fast
-from ...utils.cosmology import Cosmology
logger = logging.getLogger(__name__)
@@ -57,7 +57,6 @@ class SynchrotronEmission:
self.n_e = n_e
self.z = z
self.radius = radius # [kpc]
- self.cosmo = Cosmology()
@property
def frequency_larmor(self):
@@ -165,7 +164,7 @@ class SynchrotronEmission:
Synchrotron flux at frequency ``nu``.
Unit: [Jy] = 1e-23 [erg/s/cm^2/Hz]
"""
- DL = self.cosmo.DL(self.z) * AUC.Mpc2cm # [cm]
+ DL = cosmo.DL(self.z) * AUC.Mpc2cm # [cm]
P_nu = self.power(nu)
F_nu = 1e23 * P_nu / (4*np.pi * DL*DL) # [Jy]
return F_nu
@@ -192,7 +191,7 @@ class SynchrotronEmission:
Synchrotron surface brightness at frequency ``nu``.
Unit: [K] <-> [Jy/pixel]
"""
- DA = self.cosmo.DL(self.z) * AUC.Mpc2cm # [cm]
+ DA = cosmo.DL(self.z) * AUC.Mpc2cm # [cm]
radius = self.radius * AUC.kpc2cm # [cm]
omega = (np.pi * radius**2 / DA**2) * AUC.rad2deg**2 # [deg^2]
pixelarea = (pixelsize * AUC.arcsec2deg) ** 2 # [deg^2]