def _idx_range(arr, a, b):
    """Returns a boolean array which is True where arr is between
    a and b.
    
    Parameters
    ----------
    arr : array 
        Array to find the range in.
    a : float
        First edge of the region.
    b : float
        Second edge of the region.

    Returns
    -------
    : arr of bool
        The resulting boolean array
    """
    lower, upper = sorted([a,b])
    idx = (lower<arr) & (arr<upper)
    return idx