diff options
author | Aaron LI <aly@aaronly.me> | 2018-01-01 23:02:13 +0800 |
---|---|---|
committer | Aaron LI <aly@aaronly.me> | 2018-01-01 23:02:13 +0800 |
commit | 925d4a2e42601db7fef20b13ac0238478b51bd66 (patch) | |
tree | d4f867904956cd40ebd5eb6d50bcb82b0af46dfd /fg21sim/extragalactic/clusters/formation.py | |
parent | a543598a41af2b1488d59b57a0960e7261b37051 (diff) | |
download | fg21sim-925d4a2e42601db7fef20b13ac0238478b51bd66.tar.bz2 |
clusters/mergertree: add param mtree to maximum_merger and recent_major_merger
Diffstat (limited to 'fg21sim/extragalactic/clusters/formation.py')
-rw-r--r-- | fg21sim/extragalactic/clusters/formation.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/fg21sim/extragalactic/clusters/formation.py b/fg21sim/extragalactic/clusters/formation.py index a48d68e..38f7764 100644 --- a/fg21sim/extragalactic/clusters/formation.py +++ b/fg21sim/extragalactic/clusters/formation.py @@ -192,7 +192,7 @@ class ClusterFormation: logger.debug("Simulated cluster formation with merger tree.") return self.mtree - def recent_major_merger(self, ratio_major=3.0): + def recent_major_merger(self, mtree=None, ratio_major=3.0): """ Identify and return the most recent major merger event. @@ -213,7 +213,8 @@ class ClusterFormation: "z": z, "age": age}``; ``None`` if no major event found. """ - mtree = self.mtree + if mtree is None: + mtree = self.mtree event = None while mtree and mtree.main: if mtree.sub is None: @@ -239,8 +240,7 @@ class ClusterFormation: return event - @property - def maximum_merger(self): + def maximum_merger(self, mtree=None): """ The merger event corresponding to the biggest sub cluster, i.e., the main cluster gains the most mass. @@ -257,7 +257,8 @@ class ClusterFormation: the above ``self.recent_major_event``. ``None`` if no mergers occurred during the traced period. """ - mtree = self.mtree + if mtree is None: + mtree = self.mtree event_max = {"M_main": -1, "M_sub": -1, "R_mass": -1, "z": -1, "age": -1} while mtree and mtree.main: |