code: def findchirp_cluster_over_window(times, values, window_length):
      
      assert window_length > 0, 'Clustering window length is not positive'
  
      from weave import inline
      indices = numpy.zeros(len(times), dtype=int)
      tlen = len(times) # pylint:disable=unused-variable
      k = numpy.zeros(1, dtype=int)
      absvalues = abs(values) # pylint:disable=unused-variable
      times = times.astype(int)
      code = """
          int j = 0;
          int curr_ind = 0;
          for (int i=0; i < tlen; i++){
              if ((times[i] - times[curr_ind]) > window_length){
                  j += 1;
                  indices[j] = i;
                  curr_ind = i;
              }
              else if (absvalues[i] > absvalues[curr_ind]){
                  indices[j] = i;
                  curr_ind = i;
              }
          }
          k[0] = j;
      """
      inline(code, ['times', 'absvalues', 'window_length', 'indices', 'tlen', 'k'],
             extra_compile_args=[WEAVE_FLAGS])
      return indices[0:k[0]+1]
docs: Reduce the events by clustering over a window using
      the FindChirp clustering algorithm
  
      Parameters
      -----------
      indices: Array
          The list of indices of the SNR values
      snr: Array
          The list of SNR value
      window_size: int
          The size of the window in integer samples. Must be positive.
  
      Returns
      -------
      indices: Array
          The reduced list of indices of the SNR values