6.2.7.1.4. eqcorrscan.utils.findpeaks.find_peaks2_short

eqcorrscan.utils.findpeaks.find_peaks2_short(arr, thresh, trig_int, full_peaks=False)[source]

Determine peaks in an array of data above a certain threshold.

Uses a mask to remove data below threshold and finds peaks in what is left.

Parameters:
  • arr (numpy.ndarray) – 1-D numpy array is required

  • thresh (float) – The threshold below which will be considered noise and peaks will not be found in.

  • trig_int (int) – The minimum difference in samples between triggers, if multiple peaks within this window this code will find the highest.

  • full_peaks (bool) – If True will by decluster within data-sections above the threshold, rather than just taking the peak within that section. This will take more time. This defaults to False for match_filter.

Returns:

peaks: Lists of tuples of peak values and locations.

Return type:

list

>>> import numpy as np
>>> arr = np.random.randn(100)
>>> threshold = 10
>>> arr[40] = 20
>>> arr[60] = 100
>>> find_peaks2_short(arr, threshold, 3)
[(20.0, 40), (100.0, 60)]