def find_range(array, win):
    """ Find indices corresponding to win[0] and win[1] inside array.

    Args:
        array: <list> an array of values sorted in descending order
        win: <tuple> window ranges
    Returns:
        i0: <int> index of the first window limit
        i1: <int> index of the second window limit
    """

    a = array[:]

    i0 = None
    i1 = None

    for idx, val in enumerate(a):
        if i0 is None and win[0] >= val:
            i0 = idx
        if i1 is None and win[1] >= val:
            i1 = idx

    return i0, i1