Maeke sure the dimension coordinate of obj is
    consistent with coords.

    obj: DataArray or Dataset
    coords: Dict-like of variables

def assert_coordinate_consistent(obj, coords):
    """ Maeke sure the dimension coordinate of obj is
    consistent with coords.

    obj: DataArray or Dataset
    coords: Dict-like of variables
    """
    for k in obj.dims:
        # make sure there are no conflict in dimension coordinates
        if k in coords and k in obj.coords:
            if not coords[k].equals(obj[k].variable):
                raise IndexError(
                    'dimension coordinate {!r} conflicts between '
                    'indexed and indexing objects:\n{}\nvs.\n{}'
                    .format(k, obj[k], coords[k]))