obspy.core.util.misc.limit_numpy_fft_cache

limit_numpy_fft_cache(max_size_in_mb_per_cache=100)[source]

NumPy’s FFT implementation utilizes caches to speedup subsequent FFTs of the same size. This accumulates memory when run for various length FFTs as can readily happen in seismology.

This utility function clears both, full and real-only caches if their size is above the given threshold.

The default 100 MB is fairly generous but we still want to profit from the cache where applicable.