From 387d4c0382e33b4ed23f52685f277b2c50914b49 Mon Sep 17 00:00:00 2001 From: Yu Feng Date: Mon, 23 Oct 2017 13:30:43 -0700 Subject: [PATCH] mark the end of the loop explicitly. --- nbodykit/base/catalogmesh.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/nbodykit/base/catalogmesh.py b/nbodykit/base/catalogmesh.py index 6b646a1eb..fca8e6e9d 100644 --- a/nbodykit/base/catalogmesh.py +++ b/nbodykit/base/catalogmesh.py @@ -404,7 +404,12 @@ def to_real_field(self, out=None, normalize=True): pm.paint(p, mass=w * v, resampler=paintbrush, hold=True, out=real1) pm.paint(p, mass=w * v, resampler=paintbrush, transform=shifted, hold=True, out=real2) - if self.interlaced: + # now the loop over particles is done + + if not self.interlaced: + # nothing to do, toret is already filled. + pass + else: # compose the two interlaced fields into the final result. c1 = real1.r2c() c2 = real2.r2c()