eqcorrscan / EQcorrscan

Earthquake detection and analysis in Python.
https://eqcorrscan.readthedocs.io/en/latest/
Other
166 stars 86 forks source link

Change from resampling to use pyFFTW #316

Closed calum-chamberlain closed 5 years ago

calum-chamberlain commented 5 years ago

What does this PR do?

Changes the "resampling" process in utils.pre_processing to use .interpolate rather than .resample for speed and stability.

Borrows code from obspy for resampling, using the pyfftw interfaces in place of scipy fftpack.

Why was it initiated? Any relevant Issues?

311

PR Checklist

calum-chamberlain commented 5 years ago

This is going to be a bigger job than anticipated. Closing this but might come back to it at some point.

calum-chamberlain commented 5 years ago

I decided to try just using pyFFTW plugged in to resampling - this ends up being a lot faster than using scipy fft routines for large primes, and faster than interpolation. It is also a simple plugin for this code, and we already rely on FFTW for correlations, so installation doesn't change much (with FFTW installed pyFFTW can be installed via pip, or conda - conda will install FFTW itself if needed).