From b210982eb93a5c783819f2ad7a8758a9ff200894 Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Wed, 3 Jan 2018 22:24:06 +0800 Subject: clusters: Fix catalog data to CSV save --- fg21sim/extragalactic/clusters/main.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'fg21sim/extragalactic/clusters') diff --git a/fg21sim/extragalactic/clusters/main.py b/fg21sim/extragalactic/clusters/main.py index a29c474..6442e2a 100644 --- a/fg21sim/extragalactic/clusters/main.py +++ b/fg21sim/extragalactic/clusters/main.py @@ -394,7 +394,9 @@ class GalaxyClusters: # Pad the merger events to be same length nmax = max([cdict["merger_num"] for cdict in self.catalog]) for cdict in self.catalog: - num = cdict["merger_num"] + num = len(cdict["merger_z"]) + if num == nmax: + continue cdict.update([ ("merger_mass1", cdict["merger_mass1"] + [None]*(nmax-num)), ("merger_mass2", cdict["merger_mass2"] + [None]*(nmax-num)), -- cgit v1.2.2