wtbarnes / fiasco

Python interface to the CHIANTI atomic database
http://fiasco.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
21 stars 17 forks source link

Simplify DEM file parsing #230

Open wtbarnes opened 1 year ago

wtbarnes commented 1 year ago

Currently, I have a bunch of complicated code that tries to parse out the edges and widths in order to get the emission measure distribution from the differential emission measure distribution. This should just be simplified to compute the EM from the DEM using a simple gradient of the temperature array, e.g.

em = np.gradient(temperature_bin_centers) * dem

There's no real reliable way to get the bin edges so we should not pretend to be able to reliably parse that information. This also means that all datasets have the same number of columns which is preferable.