fix
This commit is contained in:
14
galsec.py
14
galsec.py
@@ -330,14 +330,16 @@ class Galsec:
|
|||||||
spacing between two x bins
|
spacing between two x bins
|
||||||
delta_y : Quantity[u.kpc]
|
delta_y : Quantity[u.kpc]
|
||||||
spacing between two y bins
|
spacing between two y bins
|
||||||
|
delta_z : Quantity[u.kpc]
|
||||||
|
spacing between two y bins
|
||||||
"""
|
"""
|
||||||
for fluid in self.fluids:
|
for fluid in self.fluids:
|
||||||
x_bin = np.floor(self.data[fluid]["position"][:, 0] / delta_x)
|
for i, (delta, name) in enumerate(zip([delta_x, delta_y, delta_z], ["x", "y", "z"])):
|
||||||
y_bin = np.floor(self.data[fluid]["position"][:, 1] / delta_y)
|
pos = self.data[fluid]["position"][:, i]
|
||||||
z_bin = np.floor(self.data[fluid]["position"][:, 2] / delta_z)
|
minval = np.min(pos)
|
||||||
self.data[fluid]["x_bin"] = (x_bin + 0.5) * delta_x # Store the middle value
|
bin = np.floor((pos + minval) / delta)
|
||||||
self.data[fluid]["y_bin"] = (y_bin + 0.5) * delta_y # Store the middle value
|
# Store the middle value
|
||||||
self.data[fluid]["z_bin"] = (z_bin + 0.5) * delta_z # Store the middle value
|
self.data[fluid][f"{name}_bin"] = (bin + 0.5) * delta + minval
|
||||||
|
|
||||||
def sector_analysis(
|
def sector_analysis(
|
||||||
self,
|
self,
|
||||||
|
|||||||
Reference in New Issue
Block a user