def FitWavelengthNew(self, data_original, telluric, fitorder=3, be_safe=True):
        modelfcn = UnivariateSpline(telluric.x, telluric.y, s=0)
        pars = np.zeros(fitorder + 1)
        if be_safe:
            args = (data_original, modelfcn, 0.05)
        else:
            args = (data_original, modelfcn, 100)
        output = leastsq(self.WavelengthErrorFunctionNew, pars, args=args, full_output=True, xtol=1e-12, ftol=1e-12)
        pars = output[0]

        return partial(self.Poly, pars, np.median(data_original.x), min(data_original.x), max(data_original.x)), 0.0
        # fcn = lambda pars, x: chebyshev.chebval(x, pars)
        #return partial(fcn, pars), 0.0

        #return pars
        #return lambda x: self.Poly(pars, x), 0
        #return lambda x: x - self.Poly(pars, x), 0


    ### -----------------------------------------------
    ###       Detector Resolution Fitter
    ### -----------------------------------------------
This is a vastly simplified version of FitWavelength.
dataset/ETHPy150Open kgullikson88/Telluric-Fitter/src/TelluricFitter.py/TelluricFitter.FitWavelengthNew