Skip to content
Snippets Groups Projects
Commit eb0b5de3 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Merge branch 'eagle_ngb_def2' into 'master'

Updated the IsolatedGalaxy_starformation python scripts to use the new snapshot names

See merge request !932
parents be03ddca 2ef59925
No related branches found
No related tags found
1 merge request!932Updated the IsolatedGalaxy_starformation python scripts to use the new snapshot names
...@@ -70,7 +70,7 @@ def getSFH(filename, points): ...@@ -70,7 +70,7 @@ def getSFH(filename, points):
box_size = f["/Header"].attrs["BoxSize"][0] box_size = f["/Header"].attrs["BoxSize"][0]
coordinates = f["/PartType4/Coordinates"][:, :] coordinates = f["/PartType4/Coordinates"][:, :]
mass = f["/PartType4/Masses"][:] mass = f["/PartType4/Masses"][:]
birth_time = f["/PartType4/BirthTime"][:] birth_time = f["/PartType4/BirthTimes"][:]
absmaxz = 2 # kpc absmaxz = 2 # kpc
absmaxxy = 10 # kpc absmaxxy = 10 # kpc
...@@ -111,7 +111,7 @@ def getsfrsnapwide(numbsnaps): ...@@ -111,7 +111,7 @@ def getsfrsnapwide(numbsnaps):
with h5.File(filename, "r") as f: with h5.File(filename, "r") as f:
box_size = f["/Header"].attrs["BoxSize"][0] box_size = f["/Header"].attrs["BoxSize"][0]
coordinates = f["/PartType0/Coordinates"][:, :] coordinates = f["/PartType0/Coordinates"][:, :]
SFR = f["/PartType0/SFR"][:] SFR = f["/PartType0/StarFormationRates"][:]
coordinates_star = f["/PartType4/Coordinates"][:, :] coordinates_star = f["/PartType4/Coordinates"][:, :]
masses_star = f["/PartType4/Masses"][:] masses_star = f["/PartType4/Masses"][:]
time[i] = f["/Header"].attrs["Time"] time[i] = f["/Header"].attrs["Time"]
...@@ -154,7 +154,7 @@ if __name__ == "__main__": ...@@ -154,7 +154,7 @@ if __name__ == "__main__":
# Calculate the Cumulative sum of the particles from the snap shots # Calculate the Cumulative sum of the particles from the snap shots
f = h5.File("./output_0100.hdf5", "r") f = h5.File("./output_0100.hdf5", "r")
birthtime = f["/PartType4/BirthTime"][:] * 9.778131e2 birthtime = f["/PartType4/BirthTimes"][:] * 9.778131e2
mass = f["/PartType4/Masses"][:] * 1e10 mass = f["/PartType4/Masses"][:] * 1e10
CSFH_birth = np.zeros(len(logdata[:, 0])) CSFH_birth = np.zeros(len(logdata[:, 0]))
for i in tqdm(range(len(timelog))): for i in tqdm(range(len(timelog))):
......
...@@ -139,19 +139,19 @@ SF_thresh = KS_thresh_norm * (EAGLE_Z / KS_thresh_Z0) ** (KS_thresh_slope) ...@@ -139,19 +139,19 @@ SF_thresh = KS_thresh_norm * (EAGLE_Z / KS_thresh_Z0) ** (KS_thresh_slope)
gas_pos = f["/PartType0/Coordinates"][:, :] gas_pos = f["/PartType0/Coordinates"][:, :]
gas_mass = f["/PartType0/Masses"][:] gas_mass = f["/PartType0/Masses"][:]
gas_rho = f["/PartType0/Densities"][:] gas_rho = f["/PartType0/Densities"][:]
gas_T = f["/PartType0/Temperature"][:] gas_T = f["/PartType0/Temperatures"][:]
gas_SFR = f["/PartType0/SFR"][:] gas_SFR = f["/PartType0/StarFormationRates"][:]
gas_XH = f["/PartType0/ElementMassFractions"][:, 0] gas_XH = f["/PartType0/ElementMassFractions"][:, 0]
gas_Z = f["/PartType0/Metallicities"][:] gas_Z = f["/PartType0/MetalMassFractions"][:]
gas_hsml = f["/PartType0/SmoothingLengths"][:] gas_hsml = f["/PartType0/SmoothingLengths"][:]
gas_sSFR = gas_SFR / gas_mass gas_sSFR = gas_SFR / gas_mass
# Read the Star properties # Read the Star properties
stars_pos = f["/PartType4/Coordinates"][:, :] stars_pos = f["/PartType4/Coordinates"][:, :]
stars_BirthDensity = f["/PartType4/BirthDensity"][:] stars_BirthDensity = f["/PartType4/BirthDensities"][:]
stars_BirthTime = f["/PartType4/BirthTime"][:] stars_BirthTime = f["/PartType4/BirthTimes"][:]
stars_XH = f["/PartType4/ElementAbundance"][:, 0] stars_XH = f["/PartType4/ElementMassFractions"][:, 0]
stars_BirthTemperature = f["/PartType4/BirthTemperature"][:] stars_BirthTemperature = f["/PartType4/BirthTemperatures"][:]
# Centre the box # Centre the box
gas_pos[:, 0] -= centre[0] gas_pos[:, 0] -= centre[0]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment