aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron LI <aly@aaronly.me>2019-01-30 15:52:37 +0800
committerAaron LI <aly@aaronly.me>2019-01-30 16:44:18 +0800
commite9cc0ba0df46e0b54fb2a8d8e3b315a168feac3e (patch)
tree75c6e2bb9dc61bc89aad5f818d2b96e3d4d126de
parent518f32cafe3534f8c2b0528c8b0fb7f64d6122ac (diff)
downloadfg21sim-e9cc0ba0df46e0b54fb2a8d8e3b315a168feac3e.tar.bz2
clusters/main: Add 'genuine' property for halos
Configuration option 'genuine_threshold' is added together.
-rw-r--r--fg21sim/configs/config.spec4
-rw-r--r--fg21sim/extragalactic/clusters/main.py10
2 files changed, 13 insertions, 1 deletions
diff --git a/fg21sim/configs/config.spec b/fg21sim/configs/config.spec
index 2faac91..1bfb27a 100644
--- a/fg21sim/configs/config.spec
+++ b/fg21sim/configs/config.spec
@@ -445,3 +445,7 @@ stream = option("stderr", "stdout", "", default="stderr")
bolo_freq_min = float(default=10)
bolo_freq_max = float(default=1e5)
bolo_freq_num = integer(default=256)
+
+ # The threshold for the bolometric emissivity acceleration factor to
+ # determine whether the halo is genuine/formed.
+ genuine_threshold = float(default=10)
diff --git a/fg21sim/extragalactic/clusters/main.py b/fg21sim/extragalactic/clusters/main.py
index 11aeaf6..c84ca01 100644
--- a/fg21sim/extragalactic/clusters/main.py
+++ b/fg21sim/extragalactic/clusters/main.py
@@ -92,6 +92,7 @@ class GalaxyClusters:
sec = "extragalactic/halos"
self.eta_b = configs.getn(sec+"/x_cr")
+ self.genuine_threshold = configs.getn(sec+"/genuine_threshold")
if self.use_dump_halos_data and (not self.use_dump_catalog_data):
self.use_dump_catalog_data = True
@@ -303,6 +304,7 @@ class GalaxyClusters:
spectrum = halo.calc_electron_spectrum()
spectrum_fiducial = halo.calc_electron_spectrum(fiducial=True)
factor_acc = halo.calc_acc_factor(spectrum, spectrum_fiducial)
+ genuine = factor_acc >= self.genuine_threshold
theta = halo.radius / (clinfo["DA"]*1e3) * AUC.rad2arcsec # [arcsec]
haloinfo = OrderedDict(
@@ -314,6 +316,7 @@ class GalaxyClusters:
gamma=halo.gamma, # Lorentz factors
Ke=halo.injection_rate, # [cm^-3 Gyr^-1]
factor_acc=factor_acc,
+ genuine=genuine, # bool
)
return haloinfo
@@ -330,14 +333,19 @@ class GalaxyClusters:
if cdict["merger_num"] > 0]
num = len(idx_hasmerger)
logger.info("Simulating halos for %d clusters with mergers ..." % num)
+
+ nhalo = 0
self.halos = []
for i, idx in enumerate(idx_hasmerger):
ii = i + 1
if ii % 50 == 0:
logger.info("[%d/%d] %.1f%% ..." % (ii, num, 100*ii/num))
haloinfo = self._simulate_halo1(self.catalog[idx])
+ nhalo += haloinfo["genuine"]
self.halos.append(haloinfo)
- logger.info("Simulated radio halos.")
+
+ logger.info("Simulated radio halos: %d (%.1f%%) genuine." %
+ (nhalo, 100*nhalo/num))
def _calc_halos_emission(self):
"""