I would like to get the mass unit for all particle types in a TNG300-1 snapshot.
I assumed that I would find the information in the MassTable array with 6 elements in the header.
For instance, should MassTable index 0 correspond to PartType0 (gas)?
But, after converting the masses into physical mass (divide by h), I am getting
Mass Table: ['0.0e+00 solMass', '5.9e+07 solMass', '0.0e+00 solMass', '1.1e+07 solMass', '0.0e+00 solMass', '0.0e+00 solMass']
It appears that the DM particle is on index 1 as expected (PartType1), but the gas particle (PartType0) mass is on index 3.
Could you please clarify this? Thank you.
Here is an excerpt of my code:
import h5py
import numpy as np
from astropy import units as u
f = h5py.File("/data/TNG300/output/snapdir_070/snapshot_070.0.hdf5", "r")
UnitMass = f['Header'].attrs["UnitMass_in_g"] * u.g
h = f['Header'].attrs["HubbleParam"]
UnitMass = UnitMass.to(u.Msun) / h
print(f"UnitMass: {UnitMass:.1e}")
MassTable = f['Header'].attrs['MassTable']
MassTable = list(map(lambda m: f"{m:.1e}", MassTable*UnitMass))
print("Mass Table: ", MassTable)
Dylan Nelson
11 Jun
That is correct, there are non-zero entries in MassTable only for particle types that have constant mass. DM particles (PartType1) are the only such. All other particle types have variable mass, so you find them in the respective datasets e.g. PartType0/Masses for gas.
Dear Dylan,
I would like to get the mass unit for all particle types in a TNG300-1 snapshot.
I assumed that I would find the information in the MassTable array with 6 elements in the header.
For instance, should MassTable index 0 correspond to PartType0 (gas)?
But, after converting the masses into physical mass (divide by h), I am getting
Mass Table: ['0.0e+00 solMass', '5.9e+07 solMass', '0.0e+00 solMass', '1.1e+07 solMass', '0.0e+00 solMass', '0.0e+00 solMass']
It appears that the DM particle is on index 1 as expected (PartType1), but the gas particle (PartType0) mass is on index 3.
Could you please clarify this? Thank you.
Here is an excerpt of my code:
That is correct, there are non-zero entries in MassTable only for particle types that have constant mass. DM particles (PartType1) are the only such. All other particle types have variable mass, so you find them in the respective datasets e.g. PartType0/Masses for gas.