Calculates the total damping, i.e. Gamma, by calculating the autocorrleation 
        of the position-time trace. The autocorrelation is fitted with an exponential 
        relaxation function derived in Tongcang Li's 2013 thesis (DOI: 10.1007/978-1-4614-6031-2)
        and the function (equation 4.20 in the thesis) returns the parameters with errors.

        Parameters
        ----------
        GammaGuess : float, optional
            Inital guess for BigGamma (in radians)
        FreqTrapGuess : float, optional
            Inital guess for the trapping Frequency in Hz
        silent : bool, optional
            Whether it prints the values fitted or is silent.
        MakeFig : bool, optional
            Whether to construct and return the figure object showing
            the fitting. defaults to True
        show_fig : bool, optional
            Whether to show the figure object when it has been created.
            defaults to True

        Returns
        -------
        Gamma : ufloat
            Big Gamma, the total damping in radians
        OmegaTrap : ufloat
            Trapping frequency in radians
        fig : matplotlib.figure.Figure object
            The figure object created showing the autocorrelation
            of the data with the fit
        ax : matplotlib.axes.Axes object
            The axes object created showing the autocorrelation
            of the data with the fit

def calc_gamma_from_position_autocorrelation_fit(self, GammaGuess=None, FreqTrapGuess=None, silent=False, MakeFig=True, show_fig=True):
        """
        Calculates the total damping, i.e. Gamma, by calculating the autocorrleation 
        of the position-time trace. The autocorrelation is fitted with an exponential 
        relaxation function derived in Tongcang Li's 2013 thesis (DOI: 10.1007/978-1-4614-6031-2)
        and the function (equation 4.20 in the thesis) returns the parameters with errors.

        Parameters
        ----------
        GammaGuess : float, optional
            Inital guess for BigGamma (in radians)
        FreqTrapGuess : float, optional
            Inital guess for the trapping Frequency in Hz
        silent : bool, optional
            Whether it prints the values fitted or is silent.
        MakeFig : bool, optional
            Whether to construct and return the figure object showing
            the fitting. defaults to True
        show_fig : bool, optional
            Whether to show the figure object when it has been created.
            defaults to True

        Returns
        -------
        Gamma : ufloat
            Big Gamma, the total damping in radians
        OmegaTrap : ufloat
            Trapping frequency in radians
        fig : matplotlib.figure.Figure object
            The figure object created showing the autocorrelation
            of the data with the fit
        ax : matplotlib.axes.Axes object
            The axes object created showing the autocorrelation
            of the data with the fit

        """
        autocorrelation = calc_autocorrelation(self.voltage)
        time = self.time.get_array()[:len(autocorrelation)]

        if GammaGuess==None:
            Gamma_Initial = (autocorrelation[0]-autocorrelation[int(self.SampleFreq/self.FTrap.n)])/(time[int(self.SampleFreq/self.FTrap.n)]-time[0])*2*_np.pi
        else:
            Gamma_Initial = GammaGuess

        if FreqTrapGuess==None:
            FreqTrap_Initial = self.FTrap.n
        else:
            FreqTrap_Initial = FreqTrapGuess
            
        if MakeFig == True:
            Params, ParamsErr, fig, ax = fit_autocorrelation(
                autocorrelation, time, Gamma_Initial, FreqTrap_Initial, method='position', MakeFig=MakeFig, show_fig=show_fig)
        else:
            Params, ParamsErr, _ , _ = fit_autocorrelation(
                autocorrelation, time, Gamma_Initial, FreqTrap_Initial, method='position', MakeFig=MakeFig, show_fig=show_fig)

        if silent == False:
            print("\n")
            print(
                "Big Gamma: {} +- {}% ".format(Params[0], ParamsErr[0] / Params[0] * 100))
            print(
                "Trap Frequency: {} +- {}% ".format(Params[1], ParamsErr[1] / Params[1] * 100))
            
        Gamma = _uncertainties.ufloat(Params[0], ParamsErr[0])
        OmegaTrap = _uncertainties.ufloat(Params[1], ParamsErr[1])
        
        if MakeFig == True:
            return Gamma, OmegaTrap, fig, ax
        else:
            return Gamma, OmegaTrap, None, None