

def FitWavelengthNew(self, data_original, telluric, fitorder=3, be_safe=True):
    '\n        This is a vastly simplified version of FitWavelength.\n        It takes the same inputs and returns the same thing,\n        so is a drop-in replacement for the old FitWavelength.\n\n        Instead of finding the lines, and generating a polynomial\n        to apply to the axis as x --> f(x), it fits a polynomial\n        to the delta-x. So, it fits the function for x --> x + f(x).\n        This way, we can automatically penalize large deviations in\n        the wavelength.\n        '
    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, be_safe, np.median(data_original.x), min(data_original.x), max(data_original.x)), 0.0)

dataset/ETHPy150Open kgullikson88/Telluric-Fitter/src/TelluricFitter.py TelluricFitter.FitWavelengthNew/VarMisuse@127/363 `pars`->`be_safe`