aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron LI <aly@aaronly.me>2017-09-01 19:38:37 +0800
committerAaron LI <aly@aaronly.me>2017-09-01 19:39:22 +0800
commit40a8b328dd76a5c7dd65c4e3a2586e0e40ce2fa2 (patch)
tree710f51093310b4f2bacb1e6d42c7da4be3775ee8
parenta00e95377260c4f84a8572e14f189f8f6c79214f (diff)
downloadfg21sim-40a8b328dd76a5c7dd65c4e3a2586e0e40ce2fa2.tar.bz2
clusters: Add config option "boost"
NOTE: The cluster number (especially the bright ones) may be rather small within a sky patch. This ``boost`` config option increase the expected cluster number by a specified times, for better testing purpose.
-rw-r--r--fg21sim/configs/20-extragalactic.conf.spec5
-rw-r--r--fg21sim/extragalactic/clusters/psformalism.py7
2 files changed, 10 insertions, 2 deletions
diff --git a/fg21sim/configs/20-extragalactic.conf.spec b/fg21sim/configs/20-extragalactic.conf.spec
index 5529d5f..d96f141 100644
--- a/fg21sim/configs/20-extragalactic.conf.spec
+++ b/fg21sim/configs/20-extragalactic.conf.spec
@@ -35,6 +35,11 @@
# Unit: [Msun]
mass_min = float(default=2e14, min=1e12)
+ # Boost the number of expected cluster number within the sky coverage
+ # by the specified times.
+ # (NOTE: mainly for testing purpose.)
+ boost = float(default=1.0, min=0.1, max=1e4)
+
# Minimum mass change of the main cluster to be regarded as a merger
# event instead of an accretion event.
# Unit: [Msun]
diff --git a/fg21sim/extragalactic/clusters/psformalism.py b/fg21sim/extragalactic/clusters/psformalism.py
index 508d391..ae54868 100644
--- a/fg21sim/extragalactic/clusters/psformalism.py
+++ b/fg21sim/extragalactic/clusters/psformalism.py
@@ -43,6 +43,7 @@ class PSFormalism:
comp = "extragalactic/clusters"
self.datafile = self.configs.get_path(comp+"/ps_data")
self.Mmin_cluster = self.configs.getn(comp+"/mass_min") # [Msun]
+ self.boost = self.configs.getn(comp+"/boost")
@property
def Mmin_halo(self):
@@ -150,6 +151,7 @@ class PSFormalism:
midx = (self.masses >= self.Mmin_halo)
numgrid = self.number_grid
counts = np.sum(numgrid[:, midx]) * coverage
+ counts *= self.boost # number boost factor
self.counts = int(np.round(counts))
logger.info("Total number of clusters: %d" % self.counts)
return self.counts
@@ -218,8 +220,8 @@ class PSFormalism:
M_list.append(M)
i += 1
if i % 100 == 0:
- logger.debug("[%d/%d] %.1f%% done ..." %
- (i, counts, 100*i/counts))
+ logger.info("[%d/%d] %.1f%% ..." %
+ (i, counts, 100*i/counts))
logger.info("Sampled %d pairs of (z, mass) for each cluster" % counts)
df = pd.DataFrame(np.column_stack([z_list, M_list]),
@@ -227,6 +229,7 @@ class PSFormalism:
df["mass"] /= COSMO.darkmatter_fraction
comment = [
"cluster number counts : %d" % counts,
+ "number boost : %s" % self.boost,
"z : redshift",
"mass : cluster total mass [Msun]",
]