def METHOD_NAME(self, r, e):
    r_temp = r[e != np.inf]
    e_temp = e[e != np.inf]
    # Optimising the parameter for a function for derivation
    # to be continuous.
    # Here a gaussian function, can be anything relevant defined in func.
    popt, pcov = curve_fit(self.func, r_temp[:2], e_temp[:2])
    for i, _ in enumerate(e):
        if e[i] == np.inf:
            e[i] = self.func(r[i], *popt)
    return e