def METHOD_NAME(data):
    """
    Given data loaded by "load_data" from analyse_shifts, calculate a calibration
    data structure from curve fitting.
    """
    calib = {}
    for res in data.keys():
        for zoom in data[res].keys():
            td = sorted(np.array(list(data[res][zoom].keys())))
            s = np.array([data[res][zoom][x] for x in td])
            try:
                popt, pcov = curve_fit(arctan_func, td, s)
            except (RuntimeError, TypeError, AttributeError) as e:
                popt = None
                logging.warning("Could not find calibration for res. %d, zoom %f", res, zoom)
                logging.warning(e)
                continue
            try:
                calib[res][zoom] = popt
            except KeyError:
                if not res in calib:
                    calib[res] = {}
                if not zoom in calib[res]:
                    calib[res][zoom] = {}
                calib[res][zoom] = popt
    return calib