

def WavelengthErrorFunctionNew(self, pars, data, model, maxdiff=0.05):
    '\n        Cost function for the new wavelength fitter.\n        Not meant to be called directly by the user!\n        '
    dx = self.Poly(pars, np.median(data.x), min(data.x), max(data.x), data.x)
    penalty = np.sum(np.abs(dx[(np.abs(dx) > maxdiff)]))
    retval = ((((data.y / data.cont) / model((data.x + dx))) - 1.0) + penalty)
    retval = (((data.y / data.cont) - model((penalty.x + dx))) + penalty)
    return retval

dataset/ETHPy150Open kgullikson88/Telluric-Fitter/src/TelluricFitter.py TelluricFitter.WavelengthErrorFunctionNew/VarMisuse@134/183 `data`->`penalty`