Implement optional logarithmic sampling of the photon energies#476
Implement optional logarithmic sampling of the photon energies#476ehlertdo wants to merge 2 commits intoCRPropa:masterfrom
Conversation
|
Hey @ehlertdo, For example you can see in this plot the difference of both sampling techniques. Here I ran the I guess this problem can be solved by a diffrent way of evaluating the propability after the sampling. But I do not directly now how to implement this. |
|
I guess an other way of solving the problem could be a change in the maximum photon energy CRPropa3/src/PhotonBackground.cpp Line 67 in 1ffe835 I would suggest to add a threshold photon density (maybe even 0) to evaluate the maximum energy. In this case the region with |
|
Good point about the difference in the sampled distribution. I had only checked that sampling from the build-in CMB and my tabulated version yields the same photon distribution after the modification. I will try to think about a solution. |


Hey,
this is the follow-up to #474 . With this change it is possible to sample photons from tabulated photon fields where the maximum tabulated energy is much larger than the highest energies where the field density is non-zero.
I have attached a minimal CRPropa 1D simulation script that illustrates a scenario where the current version of CRPropa fails to find photons and stops with
error: no photon found in sampleEps, please make sure that photon field provides photons for the interaction by adapting the energy range of the tabulated photon field.The files for such a tabulated (CMB-like) photon field are also included and must be placed in the share folder of the local CRPropa installation.
Let me know what you think!
supplementary_files.tar.gz