aboutsummaryrefslogtreecommitdiffstats
path: root/fg21sim/extragalactic/clusters
diff options
context:
space:
mode:
authorAaron LI <aly@aaronly.me>2017-07-20 00:08:49 +0800
committerAaron LI <aly@aaronly.me>2017-07-20 00:10:36 +0800
commit33cf456183b9ba5e6bdf858343a3e1a05ccc58d9 (patch)
treec77057c30911963a225fd31ea144e2be396caf6d /fg21sim/extragalactic/clusters
parenta172bba02606020e7ddfa3862fa32f602770c6ba (diff)
downloadfg21sim-33cf456183b9ba5e6bdf858343a3e1a05ccc58d9.tar.bz2
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 <aly@aaronly.me>
Diffstat (limited to 'fg21sim/extragalactic/clusters')
-rw-r--r--fg21sim/extragalactic/clusters/formation.py18
1 files changed, 11 insertions, 7 deletions
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