From 40a8b328dd76a5c7dd65c4e3a2586e0e40ce2fa2 Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Fri, 1 Sep 2017 19:38:37 +0800 Subject: 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. --- fg21sim/extragalactic/clusters/psformalism.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'fg21sim/extragalactic') 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]", ] -- cgit v1.2.2