Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Add WcsNDMap convolve method #1695
Image convolution is used in many places in Gammapy (
This looks great, thank you!
I'm merging this now.
Some things we might want to discuss / change next week:
Why is non-fft used for LiMa but not the others? Was there a reason not to switch to FFT for LiMA?
There was a check that the kernel pixel size roughly matches the map, that might be useful to add back.
I don't see any unit tests in the diff. weren't there some for the PSFKernel.apply that should now appear in the tests for Map.convolve?
Aug 10, 2018
@cdeil No there was no specific reason to use non-fft for Li&Ma images, except that I wanted to keep the tests unchanged for this PR. The unit tests are still in
Unfortunately the results of the convolution comparison on your mac book is not visible, just an empty image. Does it give similar results?
@adonath - Thanks!
Yes, the results were very similar, except that the crossing point where scipy.signal.fftconvolve is faster than scipy.ndimage.convolve was already a little sooner, at a kernel width of 6 or 7. So probably fftconvolve is the better default. Although that comes with the caveat that we haven't looked at it in some more detail yet, namely dependency of speed (and maybe also precision) on float type (32 and 64 bit) and on image size. Is fftconvolve well-behaved, i.e. similar for any image size? Or does it go in steps and e.g. 513 is much slower than 512?