def findIndices(bounds, data):
    """Look for boundary indices of array based on desired value range.
    """
    start = 0
    stop = len(data) - 1
    if bounds is not None:
        if bounds[0] is not None:
            while start < len(data) and data[start] < bounds[0]:
                start += 1
        if bounds[1] is not None:
            while stop >= 0 and data[stop] > bounds[1]:
                stop -= 1
        if start > 0 and start < len(data):
            start -= 1
        if stop < len(data) - 1 and stop >= 0:
            stop += 1
    return start, stop
