def FitGaussian(self, data):
        """
        This function fits a gaussian to a line. The input
        should be a small segment (~0.1 nm or so), in an xypoint structure
        Not meant to be called directly by the user!
        """
        cont = 1.0
        sig = 0.004
        minidx = np.argmin(data.y / data.cont)
        mu = data.x[minidx]
        depth = 1.0 - min(data.y / data.cont)
        pars = [cont, depth, mu, sig]
        pars, success = leastsq(self.GaussianErrorFunction, pars, args=(data.x, data.y / data.cont),
                                diag=1.0 / np.array(pars), epsfcn=1e-10)
        return pars, success


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