From 58d6f17b6f3e128bba5009b9d1e491ec5574b8dd Mon Sep 17 00:00:00 2001 From: Noe Brucy Date: Fri, 5 May 2023 20:24:35 +0200 Subject: [PATCH] fix --- galsec.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/galsec.py b/galsec.py index ed54234..a640c34 100644 --- a/galsec.py +++ b/galsec.py @@ -332,9 +332,9 @@ class Galsec: spacing between two y bins """ for fluid in self.fluids: - x_bin = np.trunc(self.data[fluid]["position"][:, 0] / delta_x) - y_bin = np.trunc(self.data[fluid]["position"][:, 1] / delta_y) - z_bin = np.trunc(self.data[fluid]["position"][:, 2] / delta_z) + x_bin = np.floor(self.data[fluid]["position"][:, 0] / delta_x) + y_bin = np.floor(self.data[fluid]["position"][:, 1] / delta_y) + z_bin = np.floor(self.data[fluid]["position"][:, 2] / delta_z) self.data[fluid]["x_bin"] = (x_bin + 0.5) * delta_x # Store the middle value self.data[fluid]["y_bin"] = (y_bin + 0.5) * delta_y # Store the middle value self.data[fluid]["z_bin"] = (z_bin + 0.5) * delta_z # Store the middle value