5.2.8.2.3. eqcorrscan.utils.mag_calc._max_p2t

eqcorrscan.utils.mag_calc._max_p2t(data, delta, return_peak_trough=False)[source]

Finds the maximum peak-to-trough amplitude and period.

Originally designed to be used to calculate magnitudes (by taking half of the peak-to-trough amplitude as the peak amplitude).

Parameters:
  • data (numpy.ndarray) – waveform trace to find the peak-to-trough in.

  • delta (float) – Sampling interval in seconds

  • return_peak_trough (bool) – Optionally return the peak and trough

Returns:

tuple of (amplitude, period, time) with amplitude in the same scale as given in the input data, and period in seconds, and time in seconds from the start of the data window.

Return type:

tuple