def find_peaks(array, baseline=0.1, return_subarrays=False):
    """
    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.
    """
    peaks = []
    if return_subarrays:
        subarray_values = []
        subarray_indices = []
    n = 0
    while n < len(array):
        if array[n] > baseline:
            if return_subarrays:
                subarray_values.append([])
                subarray_indices.append(n)
            ymax = baseline
            nmax = n
            while n < len(array) and array[n] > baseline:
                if return_subarrays:
                    subarray_values[-1].append(array[n])
                if array[n] > ymax:
                    ymax = array[n]
                    nmax = n
                n = n + 1
            peaks.append(nmax)
        else:
            n = n + 1
    if return_subarrays:
        return peaks, subarray_values, subarray_indices
    else:
        return peaks
