def get_hit_rate_correction(gdacs, calibration_gdacs, cluster_size_histogram):
logging.info('<STR_LIT>', len(gdacs))<EOL>if len(calibration_gdacs) != cluster_size_histogram.shape[<NUM_LIT:0>]:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>hist_sum = np.sum(cluster_size_histogram, axis=<NUM_LIT:1>)<EOL>hist_rel = cluster_size_histogram / hist_sum[:, np.newaxis].astype('<STR_LIT>') * <NUM_LIT><EOL>maximum_rate = np.amax(hist_rel[:, <NUM_LIT:1>])<EOL>correction_factor = maximum_rate / hist_rel[:, <NUM_LIT:1>]<EOL>calibration_gdacs_sorted = np.array(calibration_gdacs)<EOL>correction_factor_sorted = correction_factor[np.argsort(calibration_gdacs_sorted)]<EOL>calibration_gdacs_sorted = np.sort(calibration_gdacs_sorted)<EOL>interpolation = interp1d(calibration_gdacs_sorted.tolist(), correction_factor_sorted.tolist(), kind='<STR_LIT>', bounds_error=True)<EOL>return interpolation(gdacs)<EOL>
Calculates a correction factor for single hit clusters at the given GDACs from the cluster_size_histogram via cubic interpolation.

    Parameters
    ----------
    gdacs : array like
        The GDAC settings where the threshold should be determined from the calibration
    calibration_gdacs : array like
        GDAC settings used during the source scan for the cluster size calibration.
    cluster_size_histogram : numpy.array, shape=(80,336,# of GDACs during calibration)
        The calibration array

    Returns
    -------
    numpy.array, shape=(80,336,# of GDACs during calibration)
        The threshold values for each pixel at gdacs.