possible bug in convol_fft

35 views
Skip to first unread message

markus.sc...@gmail.com

unread,
Feb 28, 2025, 10:02:39 AMFeb 28
to idl-pvwave
Hi, 
in IDL 8.7 I have spotted possible bugs in convol_fft. While the output results are correct, it sometimes needlessly repeats FFTs. The way it is written, if image_FFT or kernel_FFT are provided and have the right sizes, they are not recomputed. But these size tests needlessly fail, if the inputs are not square or in the case where /no_padding is set and the kernel has a different size than the image
For the /no_padding case, the correct test should be
MAX(imageSz.DIMENSIONS[0:1] ne imageDims) ;removed [0]
MAX(kernelSz.DIMENSIONS[0:1] ne imageDims);replaced kernelDims[0]
and the other case
MAX(imageSz.DIMENSIONS[0:1] ne imageDims*2) ;removed [0]
MAX(kernelSz.DIMENSIONS[0:1] ne imageDims*2) ;removed [0]

Furthermore, the documentation for image_FFT and kernel_FFT are not clear. While they correctly instruct to set them as returned from previous calls to convol_FFT, and correctly state what they return, it does not mention that setting them avoids recomputing these FFTs.
Can someone with a current version of IDL check, if this problem is still around? 
You can find it in lib/convol_fft.pro, probably lines 73,86,113 & 130.

Thanks, Markus

Chris Torrence

unread,
Mar 10, 2025, 8:08:34 PMMar 10
to idl-pvwave
Hi Markus,

Thanks for reporting this. It is still a problem in IDL 9.1. Luckily, as you point out, the results are correct, it is just less efficient than it could be.

I have gone ahead and added all your fixes and documentation changes for IDL 9.2, shipping sometime in the next few months.

Thanks again,
Chris
NV5 Geospatial Software

Reply all
Reply to author
Forward
0 new messages