def returnExactMatch(wavecal_info, rootname):
    """Return the shift dictionary for the specified wavecal rootname.

    The rootname of a wavecal exposure is used to extract one element of
    wavecal_info (there should always be exactly one matching element).
    The shift dictionary from that matchine element is then returned.

    None will be returned if wavecal_info is empty.

    Parameters
    ----------
    wavecal_info: list of dictionaries
        List of wavecal information dictionaries

    rootname: str
        Used to find the appropriate element of wavecal_info

    Returns
    -------
    dictionary or None
        The shift dictionary corresponding to rootname, or None
    """
    if len(wavecal_info) < 1:
        return None
    for wc_dict in wavecal_info:
        if wc_dict['rootname'] == rootname:
            return wc_dict['shift_dict']
    raise RuntimeError('There should have been a matching element.')
