def get_coords_compat_with_dims(da, include_dims=None, exclude_dims=None):
    """Return the coordinates that are compatible with dims

    Parameters
    ----------
    da: xarray.DataArray
        Data array
    include_dims: set(str)
        If provided, the coordinates must have at least one of these
        dimensions
    exclude_dims: set(str)
        If provided, the coordinates must not have one of these dimnesions

    Return
    ------
    list(str)
        List of coordinates
    """
    if isinstance(include_dims, str):
        include_dims = {include_dims}
    if isinstance(exclude_dims, str):
        exclude_dims = {exclude_dims}
    coords = []
    for coord in da.coords.values():
        dims = set(coord.dims)
        if include_dims and not include_dims.intersection(dims):
            continue
        if exclude_dims and exclude_dims.intersection(dims):
            continue
        coords.append(coord)
    return coords