h5py

Looking at Units in SWIFT IC file with h5py

>>> import h5py
>>> f = h5py.File('minimal_cosmo-SWIFT.hdf5')
>>> list(f.keys())
['Code', 'Header', 'HydroScheme', 'PartType0', 'PartType1', 'RuntimePars', 'Units']
>>> un = f['Units']
>>> list(un.attrs)
['Unit length in cgs (U_L)', 'Unit mass in cgs (U_M)', 'Unit current in cgs (U_I)', 'Unit temperature in cgs (U_T)', 'Unit time in cgs (U_t)']
>>> un.attrs['Unit length in cgs (U_L)']
3.085e+21

Page last edited 2018-12-06