code: def find_peaks(array, baseline=0.1, return_subarrays=False):
      
  
      peaks = []
  
      if return_subarrays:
          subarray_values  = []
          subarray_indices = []
  
      # loop over the data
      n = 0
      while n < len(array):
          # see if we're above baseline, then start the "we're in a peak" loop
          if array[n] > baseline:
  
              # start keeping track of the subarray here
              if return_subarrays:
                  subarray_values.append([])
                  subarray_indices.append(n)
  
              # find the max
              ymax=baseline
              nmax = n
              while n < len(array) and array[n] > baseline:
                  # add this value to the subarray
                  if return_subarrays:
                      subarray_values[-1].append(array[n])
  
                  if array[n] > ymax:
                      ymax = array[n]
                      nmax = n
  
                  n = n+1
  
              # store the max
              peaks.append(nmax)
  
          else: n = n+1
  
      if return_subarrays: return peaks, subarray_values, subarray_indices
      else:                return peaks
docs: This will try to identify the indices of the peaks in array, returning a list of indices in ascending order.
  
      Runs along the data set until it jumps above baseline. Then it considers all the subsequent data above the baseline
      as part of the peak, and records the maximum of this data as one peak value.