def subset_1d(da, dim, domain):
    """Subsets data along a single dimension.
    
    Parameters
    ----------
    da : xarray.DataArray
        Data to subset.
    dim : str
        Name of dimension to subset along.
    domain : bcdp.Domain
        1D Domain object with .min and .max accessors.
        
    Returns
    -------
    xarray.DataArray
        Subsetted data.
    """
    coord = da[dim]
    dmin, dmax = domain.min, domain.max
    if dim == 'time':
        coord = coord.astype(str)
        dmin, dmax = str(dmin), str(dmax)
    selection = (coord >= dmin) & (coord <= dmax)
    return da.isel(**{dim: selection})