NaN-friendly convolution

NaN-friendly convolution is important for, e.g., masked data sets in which you want to interpolate across the masked region.

Astropy has gained this functionality with pull request 155: https://github.com/astropy/astropy/pull/155 but this is a "direct" convolution parallel to IDL's 'convol' routine.

My FFT-based version now works in N dimensions and is a little cleaner: http://code.google.com/p/agpy/source/browse/trunk/AG_fft_tools/convolve_nd.py

I'm still working on writing unit tests, and I'm really not sure what the "correct" behavior at the edges is for the different cases... right now, it seems counterintuitive to me, but the code is doing what I expect it to.

Also, Boxcar kernels always result in shifts for me... they're never supposed to. This is a bug.

Currently, other links to these codes: http://stackoverflow.com/questions/1100100/fft-based-2d-convolution-and-correlation-in-python/8454010#8454010

Comments