From 33cf456183b9ba5e6bdf858343a3e1a05ccc58d9 Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Thu, 20 Jul 2017 00:08:49 +0800 Subject: clusters/formation.py: Fix bug in "last_major_merger" property Also calculate and add the mass ratio to the event dictionary. Signed-off-by: Aaron LI --- fg21sim/extragalactic/clusters/formation.py | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'fg21sim') diff --git a/fg21sim/extragalactic/clusters/formation.py b/fg21sim/extragalactic/clusters/formation.py index 0242992..a6b215c 100644 --- a/fg21sim/extragalactic/clusters/formation.py +++ b/fg21sim/extragalactic/clusters/formation.py @@ -212,7 +212,8 @@ class ClusterFormation: event : An dictionary containing the properties of the found major event: - ``{"M_main": M_main, "M_sub": M_sub, "z": z, "age": age}``; + ``{"M_main": M_main, "M_sub": M_sub, "R_mass": R_mass, + "z": z, "age": age}``; ``None`` if no major event found. """ mtree = self.mtree @@ -222,14 +223,17 @@ class ClusterFormation: mtree = mtree.main continue - M_main = mtree.main["mass"] - M_sub = mtree.sub["mass"] - z = mtree.main["z"] - age = mtree.main["age"] + M_main = mtree.main.data["mass"] + M_sub = mtree.sub.data["mass"] + z = mtree.main.data["z"] + age = mtree.main.data["age"] if M_main / M_sub < self.ratio_major: # Found a major merger event - event = {"M_main": M_main, "M_sub": M_sub, - "z": z, "age": age} + event = {"M_main": M_main, + "M_sub": M_sub, + "R_mass": M_main / M_sub, + "z": z, + "age": age} break # A minor merger event, continue -- cgit v1.2.2