def get_redundant_grps_data(uvdata, remove_redundancy=False, tol=1.0, include_autos=False):
    """Get lists of antenna pairs and redundancies in a uvdata set.

    Provides list of antenna pairs and ant-pairs organized in redundant groups
    with the proper ordering of the antenna numbers so that there are no
    non-redundancies by conjugation only.

    Parameters
    ----------
    uvdata: UVData object.
        uvdata to get antpairs and redundant groups from.
    remove_redundancy: bool, optional
        if True, split all baselines into their own redundant groups, effectively
        removeing redundancy but allowing us to handle redundant and non-redundant
        modeling under the same framework.
    tol: float, optional
        baselines are considered redundant if their bl_x, bl_y coords are
        within tol of eachother (units of meters)
        default is 1.0m
    include_autos: bool, optional
        if True, include autocorrelations
        default is False.

    Returns
    -------
    antpairs: list of 2-tuples
        list of ant-pairs with tuples ordered to remove conjugation effects.
    red_grps: list of lists of 2-tuples.
        list of list where each list contains antpair tuples that are ordered
        so that there are no conjugates.
    vec_bin_centers: list
        list of float 3-arrays with xyz vector bin centers of each
        redundant group.
    lengths: list
        list of float lengths of redundant baselines in meters.

    """
    antpairs = []
    # set up maps between antenna pairs and redundant groups.
    red_grps, vec_bin_centers, lengths, _ = uvdata.get_redundancies(
        use_antpos=True, include_conjugates=True, include_autos=include_autos, tol=tol
    )

    # convert to ant pairs
    red_grps = [[uvdata.baseline_to_antnums(bl) for bl in red_grp] for red_grp in red_grps]

    ap_data = set(uvdata.get_antpairs())
    # make sure all red_grps in data and all conjugates in data
    red_grps = [[ap for ap in red_grp if ap in ap_data or ap[::-1] in ap_data] for red_grp in red_grps]
    lengths = [length for length, red_grp in zip(lengths, red_grps) if len(red_grp) > 0]
    vec_bin_centers = [vbc for vbc, red_grp in zip(vec_bin_centers, red_grps) if len(red_grp) > 0]
    red_grps = [red_grp for red_grp in red_grps if len(red_grp) > 0]

    antpairs = set(antpairs)

    # convert all redundancies to redundant groups with length one if
    # remove_redundancy is True.
    if remove_redundancy:
        red_grps_t = []
        vec_bin_centers_t = []
        lengths_t = []
        for red_grp, vbc, length in zip(red_grps, vec_bin_centers, lengths):
            for ap in red_grp:
                red_grps_t.append([ap])
                vec_bin_centers_t.append(vbc)
                lengths_t.append(length)
        red_grps = red_grps_t
        lengths = lengths_t
        vec_bin_centers = vec_bin_centers_t
        del red_grps_t, lengths_t, vec_bin_centers_t

    return antpairs, red_grps, vec_bin_centers, lengths