from typing import OrderedDict


def create_resolution_groups(acqs):
    """
    Given a list of acquisitions, return an OrderedDict containing
    groups of acquisitions based on the resolution.
    The order of groups is highest to lowest resolution.
    Resolution group names are given as:

    * RES-GROUP-0, RES-GROUP-1, ..., RES-GROUP-N

    :param acqs:
        A `list` of acquisition objects.

    :return:
        An OrderedDict detailed as follows:

        {'RES-GROUP-0: [acquisition, acquisition],
         'RES-GROUP-1: [acquisition, acquisition],
         'RES-GROUP-N: [acquisition, acquisition]}
    """
    fmt = "RES-GROUP-{}"
    # 0 -> n resolution sets (higest res to lowest res)
    resolutions = sorted(set([acq.resolution for acq in acqs]))
    res_groups = OrderedDict([(fmt.format(i), []) for i, _ in
                              enumerate(resolutions)])

    for acq in sorted(acqs):
        group = fmt.format(resolutions.index(acq.resolution))
        res_groups[group].append(acq)

    return res_groups