aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron LI <aly@aaronly.me>2018-01-01 15:02:55 +0800
committerAaron LI <aly@aaronly.me>2018-01-01 15:02:55 +0800
commita7c8b589bb932ce6bddcde78f48016fc88e209bd (patch)
tree4a39ddac1161e40afe296a4449c6c7b0df563d0d
parentd82487346e87aedde6b9a476d43c7b1e1a821319 (diff)
downloadfg21sim-a7c8b589bb932ce6bddcde78f48016fc88e209bd.tar.bz2
clusters/mergertree: improve print formats for "show_mtree()"
-rw-r--r--fg21sim/extragalactic/clusters/mergertree.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/fg21sim/extragalactic/clusters/mergertree.py b/fg21sim/extragalactic/clusters/mergertree.py
index 20fc3ff..9d5361a 100644
--- a/fg21sim/extragalactic/clusters/mergertree.py
+++ b/fg21sim/extragalactic/clusters/mergertree.py
@@ -1,4 +1,4 @@
-# Copyright (c) 2017 Weitian LI <liweitianux@live.com>
+# Copyright (c) 2017-2018 Weitian LI <liweitianux@live.com>
# MIT license
"""
@@ -77,18 +77,21 @@ def show_mtree(mtree):
z = main.data["z"]
age = main.data["age"]
mass = main.data["mass"]
- info = "[z=%.3f/t=%.2f]" % (z, age)
+ info = "[z=%.3f/t=%05.2f]" % (z, age)
if sub is None:
# Accretion
info += " %.3e" % mass
if parent is not None:
dM = parent.data["mass"] - mass
- info += " (dM=%.2e)" % dM
+ info += " (dM=%.2e) " % dM
else:
# Merger
Msub = sub.data["mass"]
Rmass = mass / Msub
- info += " %.3e <> %.3e (Rm=%.1f)" % (mass, Msub, Rmass)
+ info += " %.3e <> %.3e (Rm=%04.1f)" % (mass, Msub, Rmass)
+ if parent is not None:
+ info += " <dz=%.3f/dt=%.2f>" % (z-parent.data["z"],
+ parent.data["age"]-age)
return info
i = 0