def xr_collapse_across_time(da, time_slice=("2080", "2100")):
    """
    Slices an array along time and averages across time.

    Parameters
    ----------
    da : xr.DataArray
        with 'time' dimension
    time_slice : tuple of str
        first and last date of sub-period to keep.
    Returns
    ------
    data array with 'time' dropped
    """

    return da.sel(time=slice(time_slice[0], time_slice[1])).mean("time")