From badf3a969e05220a4b44683326efbe747b5e567f Mon Sep 17 00:00:00 2001 From: Jack Christopher Hutchinson Rolph <jack.rolph@desy.de> Date: Wed, 11 Jan 2023 12:17:12 +0100 Subject: [PATCH] Update PeakOTron.py --- PeakOTron.py | 42 ------------------------------------------ 1 file changed, 42 deletions(-) diff --git a/PeakOTron.py b/PeakOTron.py index 56fa800..3bcac3a 100644 --- a/PeakOTron.py +++ b/PeakOTron.py @@ -352,48 +352,6 @@ class PeakOTron: ######################################################################################################## - -# def __CalcChi2(self, x, y, y_hat, y_err): -# chi2 = np.nansum(((y_hat - y)/y_err)**2) -# ndof = len(x) - 10 -# return chi2, ndof - - - -# def GetChi2(self, prefit=False): - -# if(self._m_DRM is None): -# raise Exception ("Fit has not yet been performed. Please first perform a fit.") -# else: - -# x_all = self._hist_data["bin_numbers"] -# y_all = self._hist_data["counts"] -# y_err_all = self._hist_data["counts_error"] - -# if(self._fit_kwargs["truncate_nsigma0_do"] is not None): -# lim_nsigma0 = self._prefit_values_bin["Q_0"] - self._fit_kwargs["truncate_nsigma0_do"]*self._prefit_values_bin["sigma_0"] -# cond_sel_nsigma0 = (self._hist_data["bin_numbers"]>lim_nsigma0) - -# else: -# cond_sel_nsigma0 = np.full(len(self._hist_data["bin_numbers"]), True).astype(bool) - -# x = x_all[cond_sel_nsigma0] -# y = y_all[cond_sel_nsigma0] -# y_err = y_err_all[cond_sel_nsigma0] - -# y_hat = self.GetModel(x, prefit=prefit, bin_units=True) -# y_hat_err = np.sqrt(y_hat) - - -# plt.figure() -# plt.plot(x, (y-y_hat)/y_err) -# plt.show() - -# chi2, ndof = self.__CalcChi2(x, y, y_hat, y_err) - -# return chi2, ndof - - def GetChi2(self, pars=None, prefit=False, full=False, n_sigma_lims=[None, None]): -- GitLab