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) – List of the
obspy.core.stream.Stream
to compute the distance matrix for - allow_shift (bool) – To allow templates to shift or not?
- shift_len (float) – How many seconds for templates to shift
- cores (int) – Number of cores to parallel process using, defaults to 1.
Returns: distance matrix
Return type: Warning
Because distance is given as \(1-abs(coherence)\), negatively correlated and positively correlated objects are given the same distance.
- stream_list (list) – List of the