title: finding peak values and corresponding timestamps
body: <p>I'm trying to use scipy to identify peaks of my signals and try to get the corresponding timestamps of those peaks. Used <code>scipy.signal.find_peaks</code> (<a href="https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.find_peaks.html" rel="nofollow noreferrer">https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.find_peaks.html</a>)</p>
  
  <p>I have a large data file with <code>data</code> (Numpy ndarray) that contains all the signal values with sampling rate 200, and <code>times</code> with all the corresponding sample numbers of each signal.</p>
  
  <p>To have a snippet of the data, </p>
  
  <pre class="lang-py prettyprint-override"><code># len(data[0]) is 1028721
  data[0] = array([0.00333048, 0.00333095, 0.00333494, ..., 0.0062428 , 0.00624095,
         0.00624318])
  
  # len(times) is 1028721
  times = array([0.000000e+00, 5.000000e-03, 1.000000e-02, ..., 5.143590e+03,
         5.143595e+03, 5.143600e+03])
  </code></pre>
  
  <p>so far I got to get the peak points (mostly from scipy examples) using: </p>
  
  <pre class="lang-py prettyprint-override"><code>import matplotlib.pyplot as plt
  from scipy.signal import find_peaks, peak_prominences
  peaks, properties = find_peaks(data[0], height=None, distance = 200)
  
  plt.plot(data[0])
  plt.plot(peaks, data[0][peaks], "x")
  </code></pre>
  
  <p>If I plot the above, I do get a bunch of 'x' marks on the peak points, which is great so far.
  However, when I try to get the values of each peak, if I do <code>peaks</code> or <code>properties</code>, <code>peaks</code> returns an index which I do not know how it was derived, and properties is just an empty dictionary. </p>
  
  <p>I was wondering if I could get some help on actually getting each peak's signal values. I know it's only a snippet of my codes shown above, but was wondering if I could get on help on utilizing the <code>find_peaks</code> better. </p>
  
  <p>Ideally, I was thinking getting like <code>peaks[0]</code> or <code>properties['height']</code> returning me the signal values. </p>
  
  <p>Then, I was wondering how I could map on these peak points to the original <code>times</code> ndarray to get the corresponding timestamps. </p>
  
  <p>Any pointers would be really appreciated!!</p>