diff --git a/PeakOTron.py b/PeakOTron.py index 2315e82f0f31375e43a8b885a650daec71e66446..fd576cbaf46ef2eb7426fc8bf8b1635d6b204665 100644 --- a/PeakOTron.py +++ b/PeakOTron.py @@ -1136,7 +1136,9 @@ class PeakOTron: y_limits = [None, None], residual_limits = [-5, 5], linewidth_main = 5, - x_limits = [None, None]): + x_limits = [None, None], + display=True + ): if(labelsize is None): @@ -1209,12 +1211,12 @@ class PeakOTron: if(save_directory is not None): print("Saving figure to {0}...".format(save_directory)) fig.savefig(save_directory) - - fig.show() + if(display): + fig.show() - def PlotSummary(self, save_directory=None): + def PlotSummary(self, display=True, save_directory=None): fig = plt.figure(figsize=(20,40)) gs = gridspec.GridSpec(4, 2) @@ -1244,8 +1246,8 @@ class PeakOTron: if(save_directory is not None): print("Saving figure to {0}...".format(save_directory)) fig.savefig(save_directory) - - fig.show() + if(display): + fig.show() def GetModel(self, x): @@ -1400,16 +1402,6 @@ class PeakOTron: prominence=prominence ) - - limit_s = pedestal_s - 0.5*est_gain - limit = pedestal - 0.5*est_gain*self.scaler.scale_[0] - cond_limit_s = (x_kde_s[peaks]>limit_s) - if(sum(cond_limit_s)<3): - if(self._verbose): - print("No peaks observed above pedestal - gain/2. Continuing without thresholding...") - else: - peaks = peaks[cond_limit_s] -