diff options
author | Aaron LI <aly@aaronly.me> | 2017-06-23 20:39:27 +0800 |
---|---|---|
committer | Aaron LI <aly@aaronly.me> | 2017-06-23 20:39:27 +0800 |
commit | 0f4f81d874b7b372c96f5b1398f11a6f2e24367c (patch) | |
tree | c494934ed4387700e53d5b7771a572b24e03e5e5 /fg21sim | |
parent | 745cc1b0001236242eb4790e71a3b60c0388eb4f (diff) | |
download | fg21sim-0f4f81d874b7b372c96f5b1398f11a6f2e24367c.tar.bz2 |
halo.py + formation.py: Add argument z0
Diffstat (limited to 'fg21sim')
-rw-r--r-- | fg21sim/extragalactic/clusters/formation.py | 15 | ||||
-rw-r--r-- | fg21sim/extragalactic/clusters/halo.py | 10 |
2 files changed, 18 insertions, 7 deletions
diff --git a/fg21sim/extragalactic/clusters/formation.py b/fg21sim/extragalactic/clusters/formation.py index 1f48433..62ee297 100644 --- a/fg21sim/extragalactic/clusters/formation.py +++ b/fg21sim/extragalactic/clusters/formation.py @@ -42,7 +42,10 @@ class ClusterFormation: Parameters ---------- M0 : float - Present-day (z=0) mass (unit: Msun) of the cluster. + Cluster mass at redshift z0 + Unit: [Msun] + z0 : float + Redshift from where to simulate former merging history. configs : `ConfigManager` A `ConfigManager` instance containing default and user configurations. For more details, see the example configuration specifications. @@ -54,8 +57,9 @@ class ClusterFormation: mtree : `~MergerTree` Merging history of this cluster. """ - def __init__(self, M0, configs): + def __init__(self, M0, z0, configs): self.M0 = M0 # [Msun] + self.z0 = z0 self.configs = configs self._set_configs() @@ -182,8 +186,11 @@ class ClusterFormation: References: Ref.[1],Sec.(3.1) """ logger.info("Simulating cluster formation: " + - "M0={:.3g}[Msun] ...".format(self.M0)) - self.mtree = self._trace_formation(self.M0, dMc=self.merger_mass_min) + "M0={:.3g}[Msun] from z={:.2f} ...".format( + self.M0, self.z0)) + self.mtree = self._trace_formation(self.M0, + dMc=self.merger_mass_min, + _z=self.z0) logger.info("Simulated cluster formation with merger tree") return self.mtree diff --git a/fg21sim/extragalactic/clusters/halo.py b/fg21sim/extragalactic/clusters/halo.py index 3b62d66..3fa9d18 100644 --- a/fg21sim/extragalactic/clusters/halo.py +++ b/fg21sim/extragalactic/clusters/halo.py @@ -49,7 +49,10 @@ class HaloSingle: Parameters ---------- M0 : float - Present-day (z=0) mass (unit: Msun) of the cluster. + Cluster mass at redshift z0 + Unit: [Msun] + z0 : float + Redshift from where to simulate former merging history. configs : `ConfigManager` A `ConfigManager` instance containing default and user configurations. For more details, see the example configuration specifications. @@ -69,8 +72,9 @@ class HaloSingle: # Merger tree (i.e., merging history) of this cluster mtree = None - def __init__(self, M0, configs): + def __init__(self, M0, z0, configs): self.M0 = M0 # [Msun] + self.z0 = z0 self.configs = configs self._set_configs() @@ -113,7 +117,7 @@ class HaloSingle: mtree : `~MergerTree` Generated merger tree of this cluster. """ - self.formation = ClusterFormation(self.M0, self.configs) + self.formation = ClusterFormation(self.M0, self.z0, self.configs) self.mtree = self.formation.simulate_mergertree() return self.mtree |