def FitWavelengthNew(self, data_original, telluric, fitorder=3, be_safe=True):
        """
        This is a vastly simplified version of FitWavelength.
        It takes the same inputs and returns the same thing,
        so is a drop-in replacement for the old FitWavelength.

        Instead of finding the lines, and generating a polynomial
        to apply to the axis as x --> f(x), it fits a polynomial
        to the delta-x. So, it fits the function for x --> x + f(x).
        This way, we can automatically penalize large deviations in
        the wavelength.
        """
        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
    ### -----------------------------------------------
dataset/ETHPy150Open kgullikson88/Telluric-Fitter/src/TelluricFitter.py/TelluricFitter.FitWavelengthNew/operator `+` -> `/`