5.7.1.2. eqcorrscan.utils.findpeaks.find_peaks2_short

eqcorrscan.utils.findpeaks.find_peaks2_short(arr, thresh, trig_int, debug=0, starttime=False, samp_rate=1.0)[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.
  • debug (int) Optional, debug level 0-5
  • starttime (obspy.core.utcdatetime.UTCDateTime) Starttime for plotting, only used if debug > 2.
  • samp_rate (float) Sampling rate in Hz, only used for plotting if debug > 2.
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)]