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
69 stars 68 forks source link

Source sampling #478

Closed JulienDoerner closed 6 months ago

JulienDoerner commented 6 months ago

The sampling of the position in the SNR and pulsar distribution is done in cylindrical coordinates. The current approach misses a $r$ term for the radial componet. The differential number of sampled positions should be given by $dN = f(R, z) dV = f(R, z) \ R dR\ dZ \ d\phi$.

Additionaly the PR reduces the amount computation by skipping the normalisation of the curves. For the MC-rejection sampling only the knowleadge of the overall maximum is needed (once calculated) and not a normalized curve.

lukasmerten commented 6 months ago

Looks generally good to me. I agree that we missed that additional factor from the volume element before.

lukasmerten commented 6 months ago

Thanks, @JulienDoerner. Let's for some more comments and merge otherwise next week.

rafaelab commented 6 months ago

Looks good to me, @JulienDoerner .