aboutsummaryrefslogtreecommitdiffstats
path: root/fg21sim
diff options
context:
space:
mode:
Diffstat (limited to 'fg21sim')
-rw-r--r--fg21sim/extragalactic/clusters/clusters.py3
-rw-r--r--fg21sim/extragalactic/pointsources/fr1.py14
-rw-r--r--fg21sim/extragalactic/pointsources/fr2.py14
-rw-r--r--fg21sim/extragalactic/pointsources/radioquiet.py11
-rw-r--r--fg21sim/extragalactic/pointsources/starbursting.py11
-rw-r--r--fg21sim/extragalactic/pointsources/starforming.py11
-rw-r--r--fg21sim/galactic/snr.py4
7 files changed, 38 insertions, 30 deletions
diff --git a/fg21sim/extragalactic/clusters/clusters.py b/fg21sim/extragalactic/clusters/clusters.py
index 6886d84..94f00be 100644
--- a/fg21sim/extragalactic/clusters/clusters.py
+++ b/fg21sim/extragalactic/clusters/clusters.py
@@ -25,6 +25,7 @@ from ...utils.wcs import make_wcs
from ...utils.random import spherical_uniform
from ...utils.convert import Fnu_to_Tb_fast
from ...utils.grid import make_ellipse
+from ...utils.units import UnitConversions as AUC
logger = logging.getLogger(__name__)
@@ -480,7 +481,7 @@ class GalaxyClusters:
# Conversion coefficient: [ W/Hz/Mpc^2 ] => [ Jy ]
coef = 1.0502650403056097e-19
Fnu = coef * Lnu / (4*np.pi * distance**2) # [ Jy ]
- omega = size[0] * size[1] # [ deg^2 ]
+ omega = size[0] * size[1] * AUC.arcsec2deg**2 # [ arcsec^2 ]
Tb = Fnu_to_Tb_fast(Fnu, omega, freq)
return Tb
diff --git a/fg21sim/extragalactic/pointsources/fr1.py b/fg21sim/extragalactic/pointsources/fr1.py
index 0e052cd..49969e0 100644
--- a/fg21sim/extragalactic/pointsources/fr1.py
+++ b/fg21sim/extragalactic/pointsources/fr1.py
@@ -283,8 +283,9 @@ class FRI(BasePointSource):
Parameters
------------
- area: `~astropy.units.Quantity`
- Area of the PS, e.g., `1.0*au.sr`
+ area: float
+ Area of the PS
+ Unit: [arcsec^2]
freq: `~astropy.units.Quantity`
Frequency, e.g., `1.0*au.MHz`
@@ -318,7 +319,8 @@ class FRI(BasePointSource):
flux_core = 10**lgs # [Jy]
# core area
npix = hp.nside2npix(self.nside)
- core_area = 4 * np.pi / npix # [sr]
+ sr_to_arcsec2 = (np.rad2deg(1) * 3600) ** 2 # [sr] -> [arcsec^2]
+ core_area = 4 * np.pi / npix * sr_to_arcsec2 # [arcsec^2]
Tb_core = convert.Fnu_to_Tb_fast(flux_core, core_area, freq) # [K]
# lobe
lumo_lobe = lumo_151 * (1 - ratio_obs) / (1 + ratio_obs) # [Jy]
@@ -334,8 +336,6 @@ class FRI(BasePointSource):
Parameters
------------
- area: `~astropy.units.Quantity`
- Area of the PS, e.g., `1.0*au.sr`
freq: `~astropy.units.Quantity`
Frequency, e.g., `1.0*au.MHz`
@@ -347,9 +347,11 @@ class FRI(BasePointSource):
# Tb_list
num_ps = self.ps_catalog.shape[0]
Tb_list = np.zeros((num_ps, 2))
+ sr_to_arcsec2 = (np.rad2deg(1) * 3600) ** 2 # [sr] -> [arcsec^2]
# Iteratively calculate Tb
for i in range(num_ps):
ps_area = self.ps_catalog['Area (sr)'][i] # [sr]
- Tb_list[i, :] = self.calc_single_Tb(ps_area, freq)
+ area = ps_area * sr_to_arcsec2
+ Tb_list[i, :] = self.calc_single_Tb(area, freq)
return Tb_list
diff --git a/fg21sim/extragalactic/pointsources/fr2.py b/fg21sim/extragalactic/pointsources/fr2.py
index b40f9ff..2fd1f3e 100644
--- a/fg21sim/extragalactic/pointsources/fr2.py
+++ b/fg21sim/extragalactic/pointsources/fr2.py
@@ -302,8 +302,9 @@ class FRII(BasePointSource):
Parameters
------------
- area: `~astropy.units.Quantity`
- Area of the PS, e.g., `1.0*au.sr`
+ area: float
+ Area of the PS
+ Unit: [arcsec^2]
freq: `~astropy.units.Quantity`
Frequency, e.g., `1.0*au.MHz`
@@ -337,7 +338,8 @@ class FRII(BasePointSource):
flux_core = 10**lgs # [Jy]
# core area
npix = hp.nside2npix(self.nside)
- core_area = 4 * np.pi / npix # [sr]
+ sr_to_arcsec2 = (np.rad2deg(1) * 3600) ** 2 # [sr] -> [arcsec^2]
+ core_area = 4 * np.pi / npix * sr_to_arcsec2 # [arcsec^2]
Tb_core = convert.Fnu_to_Tb_fast(flux_core, core_area, freq) # [K]
# lobe
lumo_lobe = lumo_151 * (1 - ratio_obs) / (1 + ratio_obs) # [Jy]
@@ -359,8 +361,6 @@ class FRII(BasePointSource):
Parameters
------------
- area: `~astropy.units.Quantity`
- Area of the PS, e.g., `1.0*au.sr`
freq: `~astropy.units.Quantity`
Frequency, e.g., `1.0*au.MHz`
@@ -372,9 +372,11 @@ class FRII(BasePointSource):
# Tb_list
num_ps = self.ps_catalog.shape[0]
Tb_list = np.zeros((num_ps, 3))
+ sr_to_arcsec2 = (np.rad2deg(1) * 3600) ** 2 # [sr] -> [arcsec^2]
# Iteratively calculate Tb
for i in range(num_ps):
ps_area = self.ps_catalog['Area (sr)'][i] # [sr]
- Tb_list[i, :] = self.calc_single_Tb(ps_area, freq)
+ area = ps_area * sr_to_arcsec2
+ Tb_list[i, :] = self.calc_single_Tb(area, freq)
return Tb_list
diff --git a/fg21sim/extragalactic/pointsources/radioquiet.py b/fg21sim/extragalactic/pointsources/radioquiet.py
index 2d2eefe..f07f8dc 100644
--- a/fg21sim/extragalactic/pointsources/radioquiet.py
+++ b/fg21sim/extragalactic/pointsources/radioquiet.py
@@ -140,8 +140,9 @@ class RadioQuiet(BasePointSource):
Parameters
------------
- area: `~astropy.units.Quantity`
- Area of the PS, e.g., `1.0*au.sr2`
+ area: float
+ Area of the PS
+ Unit: [arcsec^2]
freq: `~astropy.units.Quantity`
Frequency, e.g., `1.0*au.MHz`
@@ -168,8 +169,6 @@ class RadioQuiet(BasePointSource):
Parameters
------------
- area: `~astropy.units.Quantity`
- Area of the PS, e.g., `1.0*au.sr`
freq: `~astropy.units.Quantity`
Frequency, e.g., `1.0*au.MHz`
@@ -181,9 +180,11 @@ class RadioQuiet(BasePointSource):
# Tb_list
num_ps = self.ps_catalog.shape[0]
Tb_list = np.zeros((num_ps,))
+ sr_to_arcsec2 = (np.rad2deg(1) * 3600) ** 2 # [sr] -> [arcsec^2]
# Iteratively calculate Tb
for i in range(num_ps):
ps_area = self.ps_catalog['Area (sr)'][i] # [sr]
- Tb_list[i] = self.calc_single_Tb(ps_area, freq)
+ area = ps_area * sr_to_arcsec2
+ Tb_list[i] = self.calc_single_Tb(area, freq)
return Tb_list
diff --git a/fg21sim/extragalactic/pointsources/starbursting.py b/fg21sim/extragalactic/pointsources/starbursting.py
index 8b5c597..57fd5a0 100644
--- a/fg21sim/extragalactic/pointsources/starbursting.py
+++ b/fg21sim/extragalactic/pointsources/starbursting.py
@@ -189,8 +189,9 @@ class StarBursting(BasePointSource):
Parameters
------------
- area: `~astropy.units.Quantity`
- Area of the PS, e.g., `1.0*au.sr2`
+ area: float
+ Area of the PS
+ Unit: [arcsec^2]
freq: `~astropy.units.Quantity`
Frequency, e.g., `1.0*au.MHz`
@@ -217,8 +218,6 @@ class StarBursting(BasePointSource):
Parameters
------------
- area: `~astropy.units.Quantity`
- Area of the PS, e.g., `1.0*au.sr`
freq: `~astropy.units.Quantity`
Frequency, e.g., `1.0*au.MHz`
@@ -230,9 +229,11 @@ class StarBursting(BasePointSource):
# Tb_list
num_ps = self.ps_catalog.shape[0]
Tb_list = np.zeros((num_ps,))
+ sr_to_arcsec2 = (np.rad2deg(1) * 3600) ** 2 # [sr] -> [arcsec^2]
# Iteratively calculate Tb
for i in range(num_ps):
ps_area = self.ps_catalog['Area (sr)'][i] # [sr]
- Tb_list[i] = self.calc_single_Tb(ps_area, freq)
+ area = ps_area * sr_to_arcsec2
+ Tb_list[i] = self.calc_single_Tb(area, freq)
return Tb_list
diff --git a/fg21sim/extragalactic/pointsources/starforming.py b/fg21sim/extragalactic/pointsources/starforming.py
index 5d518d8..a16d58d 100644
--- a/fg21sim/extragalactic/pointsources/starforming.py
+++ b/fg21sim/extragalactic/pointsources/starforming.py
@@ -208,8 +208,9 @@ class StarForming(BasePointSource):
Parameters
------------
- area: `~astropy.units.Quantity`
- Area of the PS, e.g., `1.0*au.sr2`
+ area: float
+ Area of the PS
+ Unit: [arcsec^2]
freq: `~astropy.units.Quantity`
Frequency, e.g., `1.0*au.MHz`
@@ -236,8 +237,6 @@ class StarForming(BasePointSource):
Parameters
------------
- area: `~astropy.units.Quantity`
- Area of the PS, e.g., `1.0*au.sr`
freq: `~astropy.units.Quantity`
Frequency, e.g., `1.0*au.MHz`
@@ -249,9 +248,11 @@ class StarForming(BasePointSource):
# Tb_list
num_ps = self.ps_catalog.shape[0]
Tb_list = np.zeros((num_ps,))
+ sr_to_arcsec2 = (np.rad2deg(1) * 3600) ** 2 # [sr] -> [arcsec^2]
# Iteratively calculate Tb
for i in range(num_ps):
ps_area = self.ps_catalog['Area (sr)'][i] # [sr]
- Tb_list[i] = self.calc_single_Tb(ps_area, freq)
+ area = ps_area * sr_to_arcsec2
+ Tb_list[i] = self.calc_single_Tb(area, freq)
return Tb_list
diff --git a/fg21sim/galactic/snr.py b/fg21sim/galactic/snr.py
index 6dcb812..cffbbe2 100644
--- a/fg21sim/galactic/snr.py
+++ b/fg21sim/galactic/snr.py
@@ -244,8 +244,8 @@ class SuperNovaRemnants:
"""
freq_ref = self.catalog_flux_freq # [ MHz ]
Fnu = flux * (frequency / freq_ref) ** (-specindex) # [ Jy ]
- omega = size[0] * size[1] # [ deg^2 ]
- pixelarea = (self.sky.pixelsize * AUC.arcsec2deg) ** 2 # [ deg^2 ]
+ omega = size[0] * size[1] * AUC.arcsec2deg**2 # [ arcsec^2 ]
+ pixelarea = self.sky.pixelsize ** 2 # [ arcsec^2 ]
if omega < pixelarea:
# The object is smaller than a pixel, so round up to a pixel area
omega = pixelarea