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

Change number of pixels in ParticleMapsContainer() #200

Open alexkaapa opened 6 years ago

alexkaapa commented 6 years ago

Is it possible to change the number of pixels in the map in ParticleMapsContainer() from the default of 12*64^2 pixels? Or is there at least some way to change the number of pixels when plotting the map in healpix? All I want to is to change the resolution of a map created via magnetic lensing when plotting in healpix.

TobiasWinchen commented 6 years ago

This is not easily possible right now, as the number of pixels is hard coded in the lenses and thus the particle maps container. If absolutely necessary you could try to change the number 6 in line 64 of Pixelization.h to a different order, but this may have side effects.

For plotting you probably want to smooth the map? If this is the case, you probably should loop over the desired lat/lon grid of the plot and sum up the pixels in a cone of fixed radius using getPixelsInCone method of the pixelization. In particular, this allows e.g. to apply different smoothing kernels.

In the future, we should probably make this configurable by replacing the hard coded healpix order in line 64 of Pixelization.h with a default (to ensure backwards compatibility), and storing the order inside the lenses. This would allow also higher / lower resolution lenses.