zblz / naima

Derivation of non-thermal particle distributions through MCMC spectral fitting
http://naima.readthedocs.io
BSD 3-Clause "New" or "Revised" License
45 stars 54 forks source link

Error in delta functional approximation of Kelner et al PionDecay implementation #155

Closed 55hyan closed 7 years ago

55hyan commented 7 years ago

Hi, I found something wrong in your core, maybe it is not a big problem, but I want to tell you.

(http://naima.readthedocs.io/en/latest/_modules/naima/radiative.html#PionDecay)

In this modules, in def _delta_integrand(self, Epi), you return qpi / np.sqrt(Epi2 + self._m_pi2). But in Kelner et al. 2006, in formula(78), it should be qpi / np.sqrt(Epi2 -self._m_pi2), you should change the "+" to "-".

zblz commented 7 years ago

@55hyan - You are correct, that sign is wrong! Note that this implementation is not the one used in the PionDecay class, which uses the Kafexhiu et al. parametrization.

Fixing the sign resulted in a change of 0.06% over the luminosity of a broad spectrum but might be more important when considering the spectral shape at low energies.

Thanks for the report!