Update sectors extractions scripts

This commit is contained in:
Noe Brucy
2023-05-05 18:11:31 +02:00
parent 85cfd71b66
commit 946f11725e
3 changed files with 197 additions and 2 deletions

View File

@@ -229,6 +229,7 @@ class Galsec:
A dataset of cells in the following format:
header:
time float [Myr] time since the start of the simulation
fluids str list list of fluids included
gas:
position float array (Ngas, 3) [kpc], centered
volume float array (Ngas) [pc^3]
@@ -251,6 +252,8 @@ class Galsec:
"""
self.data = {}
if "fluids" in data["header"]:
self.fluids = data["header"]["fluids"]
for fluid in self.fluids:
self.data[fluid] = QTable(data[fluid], units=self.units[fluid], copy=copy)
@@ -406,8 +409,8 @@ class Galsec:
filtered_data = self.data[fluid][
(self.data[fluid]["r"] > rmin)
& (self.data[fluid]["r"] < rmax)
& (self.data[fluid]["z"] > zmin)
& (self.data[fluid]["z"] < zmax)
& (self.data[fluid]["position"][:, 2] > zmin)
& (self.data[fluid]["position"][:, 2] < zmax)
]
grouped_data[fluid] = filtered_data.group_by(["r_bin"])
self.rings[fluid] = hstack(