CRPropa / CRPropa3

CRPropa is a public astrophysical simulation framework for propagating extraterrestrial ultra-high energy particles. https://crpropa.github.io/CRPropa3/
https://crpropa.desy.de
GNU General Public License v3.0
68 stars 67 forks source link

Targeting #378

Closed avvliet closed 2 years ago

avvliet commented 2 years ago

This pull request adds a targeted emission routine to the sources. The particles are emitted following a von-Mises-Fisher distribution and given a weight so that it is possible to obtain a distribution as if the particles were emitted isotropically. It also adds an example on how to use this targeted emission, including a learning method to obtain optimised parameters for the von-Mises-Fisher parameters.

lukasmerten commented 2 years ago

Hi @avvliet In general this looks good to me. I'll have a closer look as soon as possible, but the following things came already to my mind:

  1. Please add a short comment in the CHANGELOG, so we do not forget this feature in the next release notes.
  2. Is the calculation of the rotation parameter (alpha, delta, etc.) time critical? Since the parameters do not change after a source was initialized, there is no need to recalculate them every time the prepareCandidate method is called.
  3. Some simple test, e.g. checking the mean emission direction, (included in testSource.cpp) would be nice.
avvliet commented 2 years ago

Hi @lukasmerten Thanks for checking and commenting on this pull request. I've implemented all the points that you mentioned, so please have a look again.

lukasmerten commented 2 years ago

Thanks for the quick improvements. Let's wait for other other comments for one more day. I'll merge it if nothing else comes up.

rafaelab commented 2 years ago

Thanks, @avvliet. It looks good to me. I think it can already be merged if no one else has comments.