neuroprob/utils/signal.py
def ConsecutiveArrays(arr, step=1):
    """
    Finds consecutive subarrays satisfying monotonic stepping with step in array.
    Returns on each array element the island index (starting from 1).
    
    :param list colors: colors to be included in the colormap
    :param string name: name the colormap
    :returns: figure and axis
    :rtype: tuple
    """
    islands = 1 # next island count
    island_ind = np.zeros(arr.shape)
    on_isl = False
    for k in range(1, arr.shape[0]):
        if arr[k] == arr[k-1] + step:
            if on_isl is False:
                island_ind[k-1] = islands
                on_isl = True
            island_ind[k] = islands
        elif on_isl is True:
            islands += 1
            on_isl = False
    
    return island_ind

    Finds consecutive subarrays satisfying monotonic stepping with step in array.
    Returns on each array element the island index (starting from 1).
    
    :param list colors: colors to be included in the colormap
    :param string name: name the colormap
    :returns: figure and axis
    :rtype: tuple
    
Finds consecutive subarrays satisfying monotonic stepping with step in array.
Returns on each array element the island index (starting from 1).
Finds consecutive subarrays satisfying monotonic stepping with step in array . Returns on each array element the island index ( starting from 1 ) .
def ConsecutiveArrays(arr, step=1):
    islands = 1 
    island_ind = np.zeros(arr.shape)
    on_isl = False
    for k in range(1, arr.shape[0]):
        if arr[k] == arr[k-1] + step:
            if on_isl is False:
                island_ind[k-1] = islands
                on_isl = True
            island_ind[k] = islands
        elif on_isl is True:
            islands += 1
            on_isl = False
    return island_ind
def ConsecutiveArrays ( arr , step = 1 ) : islands = 1 island_ind = np . zeros ( arr . shape ) on_isl = False for k in range ( 1 , arr . shape [ 0 ] ) : if arr [ k ] == arr [ k - 1 ] + step : if on_isl is False : island_ind [ k - 1 ] = islands on_isl = True island_ind [ k ] = islands elif on_isl is True : islands += 1 on_isl = False return island_ind
Finds consecutive subarrays satisfying monotonic stepping with step in array.
Finds consecutive subarrays satisfying monotonic stepping with step in array .
"""
    Finds consecutive subarrays satisfying monotonic stepping with step in array.
    Returns on each array element the island index (starting from 1).
    
    :param list colors: colors to be included in the colormap
    :param string name: name the colormap
    :returns: figure and axis
    :rtype: tuple
    """ # next island count
figure and axis
figure and axis
tuple
arr
step
colors
colors to be included in the colormap
colors to be included in the colormap
name
name the colormap
name the colormap