def find_max_tech_capacity(capacity):
    """
    Calculate the technology with greatest capacity at each plant.

    Parameters
    ----------
    capacity : DataFrame
        dataframe with capacity by generator at every plant

    Returns
    -------
    dictionary
        mapping of plant_id to the technology with largest total capacity

    """

    sum_cap = capacity.groupby(['plant_id', 'technology']).sum()
    max_tech = {}

    for plant in capacity['plant_id'].unique():
        tech = sum_cap.loc[plant, 'nameplate_capacity_mw'].idxmax()

        max_tech[plant] = tech

    return max_tech