This commit is contained in:
Noe Brucy
2023-05-08 17:54:46 +02:00
parent 58d6f17b6f
commit 125f62a5cc

View File

@@ -330,14 +330,16 @@ class Galsec:
spacing between two x bins
delta_y : Quantity[u.kpc]
spacing between two y bins
delta_z : Quantity[u.kpc]
spacing between two y bins
"""
for fluid in self.fluids:
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
for i, (delta, name) in enumerate(zip([delta_x, delta_y, delta_z], ["x", "y", "z"])):
pos = self.data[fluid]["position"][:, i]
minval = np.min(pos)
bin = np.floor((pos + minval) / delta)
# Store the middle value
self.data[fluid][f"{name}_bin"] = (bin + 0.5) * delta + minval
def sector_analysis(
self,