Skip to content

Python implementation of secondary electron spectrum from Bethe-Heitler pair production via the Kelner & Aharonian (2008) parametrisation

Notifications You must be signed in to change notification settings

ehlertdo/Kelner_pairproduction_electron_SED

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This is a straightforward implementation of the Kelner & Aharonian (2008) analytical parametrisation of the electron spectrum for Bethe-Heitler pair production (see Eq. 62 in their paper) for arbitrary tabulated photon fields. An example photon field (CMB) and output spectrum are provided for illustration purposes. The output was checked against Fig. 10 in the paper.

The output file format is intended to be compatible with CRPropa3-data.

There are two branches:

(a) main: The integration loops are implemented in kelner.c and loaded into the python script via ctypes. Before running the script (python secondary_electron_spectrum.py), the C code must be compiled for the local machine (gcc -fPIC -O -shared -o kelner.so kelner.c). Execution of the script takes a few seconds for a single target proton energy.

(b) numba: Full-python implementation. Numba is used to run the script in a reasonable amount of time. Factor ~10 slower than the code with C & ctypes.

About

Python implementation of secondary electron spectrum from Bethe-Heitler pair production via the Kelner & Aharonian (2008) parametrisation

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published