In [ ]:
    
import h5py
import numpy as np
import matplotlib
matplotlib.rcParams['figure.dpi'] = 150
import matplotlib.pyplot as plt
    
In [ ]:
    
h5f = h5py.File('apec_emissivity_v2.h5', 'r')
    
In [ ]:
    
for k, v in h5f.items():
    print(k, v)
    
E, emissivity_metals, emissivity_primordial, and log_T.E is a 1D array that has 151 numbers. These are the edges of the energy bin.
log_T is a 1D array that has 100 numbers.
emissivity_metals and emissivity_primordial are 2D arrays that have 100 by 150. These are the average emissivity in each energy bin corresponding to the 100 temperatures in log_T. The unit is in [erg/s/keV$\cdot$cm$^3$].
In [ ]:
    
h5f['E'].value
    
In [ ]:
    
E = h5f['E'].value
emis_primordial = h5f['emissivity_primordial'].value
emis_metals = h5f['emissivity_metals'].value
log_T = h5f['log_T'].value
# Close the file as we don't need it anymore
h5f.close()
    
In [ ]:
    
dE = E[1:] - E[:-1]
print(dE.shape)
print(dE)
    
In [ ]:
    
    
In [ ]:
    
    
In [ ]:
    
    
In [ ]:
    
    
In [ ]:
    
    
In [ ]:
    
    
Hint: Use the masks in python to select the energy range (http://danielandreasen.github.io/:about/2015/01/19/masks-in-python/)
In [ ]:
    
    
In [ ]: