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

Update PeakOTron.py

parent d183875d
No related branches found
No related tags found
No related merge requests found
...@@ -1226,12 +1226,17 @@ class PeakOTron: ...@@ -1226,12 +1226,17 @@ class PeakOTron:
if(self._verbose): if(self._verbose):
print("Fitting...") print("Fitting...")
m_DRM.strategy=1 m_DRM.strategy=2
m_DRM.errordef=m_DRM.LIKELIHOOD m_DRM.errordef=m_DRM.LIKELIHOOD
m_DRM.migrad(ncall = self._n_call_minuit, m_DRM.migrad(ncall = self._n_call_minuit,
iterate= self._n_iterations_minuit) iterate= self._n_iterations_minuit)
########################################################################################################
##Make a copy of the basic fit.
########################################################################################################
m_DRM_GP = deepcopy(m_DRM)
######################################################################################################## ########################################################################################################
...@@ -1246,6 +1251,19 @@ class PeakOTron: ...@@ -1246,6 +1251,19 @@ class PeakOTron:
m_DRM.strategy=2 m_DRM.strategy=2
m_DRM.migrad(ncall = self._n_call_minuit, m_DRM.migrad(ncall = self._n_call_minuit,
iterate= self._n_iterations_minuit) iterate= self._n_iterations_minuit)
########################################################################################################
## If the basic GP fit performs best, it means there isn't enough information between the peaks to fit dark counts/correlated noise. This fit is used
## in preference.
########################################################################################################
if(m_DRM_GP.fval < m_DRM.fval):
if(self._verbose):
print("Standard GP model fitted better than GP+DCR+AP. Implies peaks are too close to resolve inter-peak regions. DCR and pAp set to 0.")
m_DRM = m_DRM_GP
m_DRM.hesse() m_DRM.hesse()
self._m_DRM = m_DRM self._m_DRM = m_DRM
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment