From 89e00a8252df9c00c4421cc145f8b548b876b74c Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Tue, 2 Jan 2018 15:31:39 +0800 Subject: clusters: simulate and extract all recent merger events Remove the obsolete options: ratio_major, use_max_merger --- fg21sim/configs/20-extragalactic.conf.spec | 10 ---- fg21sim/extragalactic/clusters/main.py | 82 ++++++++++++------------------ 2 files changed, 33 insertions(+), 59 deletions(-) diff --git a/fg21sim/configs/20-extragalactic.conf.spec b/fg21sim/configs/20-extragalactic.conf.spec index 02d7f00..22c2787 100644 --- a/fg21sim/configs/20-extragalactic.conf.spec +++ b/fg21sim/configs/20-extragalactic.conf.spec @@ -129,16 +129,6 @@ # Unit: [Gyr] time_traceback = float(default=3.0, min=1.0, max=5.0) - # Mass ratio of the main and sub clusters, below which is regarded as - # a major merger event. - ratio_major = float(default=5.0, min=1.0, max=10.0) - - # Whether to use the maximum merger event (i.e., biggest mass of the - # sub cluster) within the above ``tau_merger`` timescale to simulate the - # subsequent radio halo simulation? Otherwise only the most recent major - # merger event will be used. - use_max_merger = boolean(default=False) - # The fraction of the magnetic field energy density w.r.t. the ICM # thermal energy density, which is used to determine the mean magnetic # field strength within the ICM and is also assumed to be uniform. diff --git a/fg21sim/extragalactic/clusters/main.py b/fg21sim/extragalactic/clusters/main.py index 92bd722..cf5a3dc 100644 --- a/fg21sim/extragalactic/clusters/main.py +++ b/fg21sim/extragalactic/clusters/main.py @@ -86,8 +86,6 @@ class GalaxyClusters: self.prefix = self.configs.getn(comp+"/prefix") self.output_dir = self.configs.get_path(comp+"/output_dir") self.merger_mass_min = self.configs.getn(comp+"/merger_mass_min") - self.ratio_major = self.configs.getn(comp+"/ratio_major") - self.use_max_merger = self.configs.getn(comp+"/use_max_merger") self.time_traceback = self.configs.getn(comp+"/time_traceback") self.frequencies = self.configs.frequencies self.filename_pattern = self.configs.getn("output/filename_pattern") @@ -176,40 +174,20 @@ class GalaxyClusters: def _simulate_mergers(self): """ - Simulate the *recent major/maximum merger* event for each cluster. - - First simulate the cluster formation history by tracing the - merger and accretion events of the main cluster, then identify - the most recent major merger event according to the mass ratio - of two merging clusters. If ``self.use_max_merger=True`` then - the recent maximum merger (associated with biggest sub cluster) - is selected. The merger event properties are then appended to - the catalog for subsequent radio halo simulation. - - NOTE - ---- - There may be no such recent *major* merger event satisfying the - criteria, since we only trace ``time_traceback`` (~2-3 Gyr) back. - On the other hand, the cluster may only experience minor merger - or accretion events. + Simulate the formation history of each cluster to build their + merger histories. Catalog Items ------------- - rmm_mass1, rmm_mass2 : - [Msun] masses of the main and sub clusters upon the recent - major/maximum merger event - rmm_z, rmm_age : redshift and cosmic age [Gyr] - of the recent major/maximum merger event. + merger_num : number of merger events within the traced period + merger_mass1, merger_mass2 : + [Msun] masses of the main and sub clusters of each merger. + merger_z, merger_age : redshifts and cosmic ages [Gyr] + of each merger event. """ - logger.info("Simulating the galaxy formation to identify " + - "the most recent major/maximum merger event ...") - if self.use_max_merger: - logger.info("Use the recent *maximum* merger event!") - else: - logger.info("Use the recent *major* merger event!") - + logger.info("Simulating merger histories for each cluster ...") num = len(self.catalog) - num_rmm = 0 + num_hasmerger = 0 for i, cdict in enumerate(self.catalog): ii = i + 1 if ii % 100 == 0: @@ -220,28 +198,34 @@ class GalaxyClusters: clform = ClusterFormation(M0=M0, z0=z0, zmax=zmax, merger_mass_min=self.merger_mass_min) clform.simulate_mtree(main_only=True) - if self.use_max_merger: - # NOTE: may be ``{}`` due to no mergers occurred. - mmev = clform.maximum_merger() + mergers = clform.mergers() + if mergers: + num_hasmerger += 1 + cdict.update([ + ("merger_num", len(mergers)), + ("merger_mass1", [ev["M_main"] for ev in mergers]), + ("merger_mass2", [ev["M_sub"] for ev in mergers]), + ("merger_z", [ev["z"] for ev in mergers]), + ("merger_age", [ev["age"] for ev in mergers]), + ]) else: - mmev = clform.recent_major_merger(ratio_major=self.ratio_major) - if mmev: - num_rmm += 1 - cdict.update([ - ("rmm_mass1", mmev.get("M_main")), - ("rmm_mass2", mmev.get("M_sub")), - ("rmm_z", mmev.get("z")), - ("rmm_age", mmev.get("age")), - ]) + cdict.update([ + ("merger_num", 0), + ("merger_mass1", []), + ("merger_mass2", []), + ("merger_z", []), + ("merger_age", []), + ]) self.comments += [ - "rmm_mass1 - [Msun] main cluster mass of recent major/max merger", - "rmm_mass2 - [Msun] sub cluster mass of recent major/max merger", - "rmm_z - redshift of the recent major/maximum merger", - "rmm_age - [Gyr] cosmic age at the recent major/maximum merger", + "merger_num - number of merger events", + "merger_mass1 - [Msun] main cluster mass of each merger", + "merger_mass2 - [Msun] sub cluster mass of each merger", + "merger_z - redshift of each merger", + "merger_age - [Gyr] cosmic age at each merger", ] - logger.info("%d (%.1f%%) clusters have recent major/maximum mergers." % - (num_rmm, 100*num_rmm/num)) + logger.info("%d (%.1f%%) clusters experience recent mergers." % + (num_hasmerger, 100*num_hasmerger/num)) def _simulate_halos(self): """ -- cgit v1.2.2