def get_metrics(ds):
    """
    Return a dict with the available metrics, to be used with xgcm.Grid

    Parameters
    ----------
    ds : xarray.Dataset
        domain_cfg
        or DataSet returned by xnemogcm._merge_nemo_and_domain_cfg
        or Dataset returned by xnemogcm.open_nemo_and_domain_cfg
        Should contain the outputed metrics, in a standard format 'e3x'
        with x an arakawa point in lower case

    Returns
    -------
    metrics : dict
        dict understood by xgcm.Grid, metrics argument
    """
    metrics = {
        ("X",): ["e1t", "e1u", "e1v", "e1f"],  # X distances
        ("Y",): ["e2t", "e2u", "e2v", "e2f"],  # Y distances
        ("Z",): [
            "e3t",
            "e3u",
            "e3v",
            "e3f",
            "e3w",
            "e3uw",
            "e3vw",
            "e3fw",
        ],  # Z distances
    }
    metrics_output = {}
    for point in metrics.keys():
        m = []
        for e in metrics[point]:
            if e in ds.variables:
                m.append(e)
        metrics_output[point] = m
    return metrics_output