HEXRD / hexrd

A cross-platform, open-source library for the analysis of X-ray diffraction data.
Other
54 stars 26 forks source link

Use scipy's `convolve` for snip1d #630

Closed psavery closed 3 months ago

psavery commented 3 months ago

According to the scipy documentation, convolve will automatically pick which method to use depending on which method it thinks will be faster.

We were forcing it to use fftconvolve before, which, for our example, took about 1.588 seconds to run. Switching to convolve now takes about 0.468 seconds instead, so it is noticeably faster.

In our example, the final snip1d result had a max difference of 2.6e-13 compared to using fftconvolve, so it appears to have a minimal impact on the results.