Dark Matter Particles Masses

Jason Parisi
  • 1
  • 27 Jul '16

I'm trying to access the dark matter particle masses (which I understand are all equal at a given snapshot). I have attempted to access the Header snapshot with the MassTable field, but have been unable to figure out how to do so. Thus far, I have tried

headerfile = il.groupcat.loadHeader(basePath,illustrisslice)

but this Header file does not contain the 'MassTable' field. On previous help topics I have seen

h = cosmo.load.snapshotHeader()

but could not figure out how to replicate. Any assistance much appreciated,

Dylan Nelson
  • 28 Jul '16


The MassTable will be in the header of any snapshot file, but not in the header of a group catalog file, which is what the groupcat.loadHeader() function loads.

But this function is very simple, e.g.

with h5py.File('any_snapshot_file_chunk_here.0.hdf5,'r') as f:
    header = dict( f['Header'].attrs.items() )

print(header['MassTable'][1]) # 10^10 msun/h
Jason Parisi
  • 29 Jul '16

Excellent, thank you Dylan.

  • Page 1 of 1