5.4.1.7. eqcorrscan.utils.clustering.distance_matrix

eqcorrscan.utils.clustering.distance_matrix(stream_list, allow_shift=False, shift_len=0, cores=1)[source]

Compute distance matrix for waveforms based on cross-correlations.

Function to compute the distance matrix for all templates - will give distance as 1-abs(cccoh), e.g. a well correlated pair of templates will have small distances, and an equally well correlated reverse image will have the same distance as a positively correlated image - this is an issue.

Parameters:
  • stream_list (List of obspy.Streams) List of the streams to compute the distance matrix for
  • allow_shift (bool) To allow templates to shift or not?
  • shift_len (int) How many samples for templates to shift in time
  • cores (int) Number of cores to parallel process using, defaults to 1.
Returns:

ndarray - distance matrix