def WavelengthErrorFunction(self, shift, data, model):
        """
        Error function for the scipy.minimize fitters. Not meant to be
        called directly by the user!
        """
        modelfcn = UnivariateSpline(model.x, model.y, s=0)
        weight = 1e9 * np.ones(data.x.size)
        weight[data.y > 0] = 1.0 / np.sqrt(data.y[data.y > 0])
        weight[weight < 0.01] = 0.0
        newmodel = modelfcn(model.x + float(shift))
        if shift < 0:
            newmodel[model.x - float(shift) < model.x[0]] = 0
        else:
            newmodel[model.x - float(shift) > model.x[-1]] = 0
        returnvec = (data.y - newmodel) ** 2 * weight
        return returnvec


    ### -----------------------------------------------
dataset/ETHPy150Open kgullikson88/Telluric-Fitter/src/TelluricFitter.py/TelluricFitter.WavelengthErrorFunction/original