def reduce_dataset(data, vars_to_keep, coords_to_keep):
    """ Removes all variables and coordinates from input dataset that are not
    listed in paramters.

    Parameters
    ----------
    data : xarray.Dataset
    vars_to_keep : sequence of strings
    dims_to_keep : sequence of strings

    Returns
    -------
    xarray.Dataset
    """
    for v in data.data_vars:
        if v not in vars_to_keep:
            data = data.drop(v)
    for c in data.coords:
        if c not in coords_to_keep:
            data = data.drop(c)
    return data