5.2.5.1.2. eqcorrscan.utils.correlate.fftw_normxcorr

eqcorrscan.utils.correlate.fftw_normxcorr(templates, stream, pads, threaded=False, *args, **kwargs)[source]

Normalised cross-correlation using the fftw library.

Internally this function used double precision numbers, which is definitely required for seismic data. Cross-correlations are computed as the inverse fft of the dot product of the ffts of the stream and the reversed, normalised, templates. The cross-correlation is then normalised using the running mean and standard deviation (not using the N-1 correction) of the stream and the sums of the normalised templates.

This python function wraps the C-library written by C. Chamberlain for this purpose.

Parameters:
  • templates (np.ndarray) – 2D Array of templates

  • stream (np.ndarray) – 1D array of continuous data

  • pads (list) – List of ints of pad lengths in the same order as templates

  • threaded (bool) – Whether to use the threaded routine or not - note openMP and python multiprocessing don’t seem to play nice for this.

Returns:

np.ndarray of cross-correlations

Returns:

np.ndarray channels used