cosmicrays / hermes

HERMES is a publicly available computational framework for the line of sight integration over galactic radiative processes which creates sky maps in the HEALPix-compatibile format.
GNU General Public License v3.0
22 stars 9 forks source link

Integrating over photon energy #44

Closed fayezACE closed 1 year ago

fayezACE commented 1 year ago

Hello:

The skymaps Hermes produces are differential flux for a specific photon energy Egamma. I would like to integrate over the photon energy so that I get skymaps with the total energy flux, i.e. I want to do the integral $\int{Emin}^{Emax}$ dE{\gamma} \epsilon E_{\gamma}$, however, there is a problem doing this because in order for the Skymap integrator in Hermes to work, I need to specify Egamma from the start. I tried this in Jupyter Notebook

def integrate_function(emissivity, energy_min, energy_max): integrand = lambda energy: emissivity * energy result, _ = quad(integrand, energy_min, energy_max) return result

However, I can't do Skymap.compute() keeping Egamma as unknown. I need to somehow convolve my energy integral with Hermes's Skymap integral. I am not sure how to do that. I tried to look into the integrator files, but it's not clear where I should modify the code.

I appreciate your help

Best regards

carmeloevoli commented 1 year ago

Hi @fayezACE , unfortunately you have to compute the map at a given photon energy, you should adapt your integrator to use this function. This issue however is not related to the hermes code and it would rather require the help of someone with some expertise in numerical calculations.