def range_limit(u, range=[-5, 5]):
    """
    Returns a logical vector that is True where the values of `u` are 
    outside of `range`.

    Parameters
    ----------
    u : xarray.DataArray
      The timeseries data to clean.
    range : list
       Min and max magnitudes beyond which are masked

    Returns
    -------
    mask : |np.ndarray|
      Logical vector with spikes labeled as 'True'

    """
    return ~((range[0] < u.values) & (u.values < range[1]))