From a7c8b589bb932ce6bddcde78f48016fc88e209bd Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Mon, 1 Jan 2018 15:02:55 +0800 Subject: clusters/mergertree: improve print formats for "show_mtree()" --- fg21sim/extragalactic/clusters/mergertree.py | 11 +++++++---- 1 file 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 +# Copyright (c) 2017-2018 Weitian LI # 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 += " " % (z-parent.data["z"], + parent.data["age"]-age) return info i = 0 -- cgit v1.2.2