Skip to content
Snippets Groups Projects
Commit badf3a96 authored by Jack Christopher Hutchinson Rolph's avatar Jack Christopher Hutchinson Rolph
Browse files

Update PeakOTron.py

parent 2c9b1752
No related branches found
No related tags found
No related merge requests found
......@@ -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]):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment