diff --git a/PeakOTron.py b/PeakOTron.py index fd576cbaf46ef2eb7426fc8bf8b1635d6b204665..bec81f1b2d98b21fd4b9761deb6c6a26a8ee6f60 100644 --- a/PeakOTron.py +++ b/PeakOTron.py @@ -1216,7 +1216,7 @@ class PeakOTron: - def PlotSummary(self, display=True, save_directory=None): + def PlotSummary(self, save_directory=None): fig = plt.figure(figsize=(20,40)) gs = gridspec.GridSpec(4, 2) @@ -1402,6 +1402,16 @@ 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] +