def plotpeaks(self): """ This Finds the peaks, then plots both the data and the compressed peaks on the graph""" self.ui.statusbar.showMessage('Finding Peaks') self.peaks = epic.peakfinder(self.data,self.peakcutoff) self.peakplot = epic.peakplotter(self.data,self.peaks) self.mpl.axes.cla() self.mpl.axes.plot(self.currenttime,self.peakplot,self.currenttime,self.currentdata,'--') self.mpl.axes.xaxis.set_major_formatter(epic.tick.FuncFormatter(epic.axesformatter)) self.mpl.draw() self.ui.statusbar.showMessage('Ready')
def findpeaks(self): """ This runs the peak finding routine, then prints out the time of each peak in a message box """ self.ui.statusbar.showMessage('Finding Peaks') self.peaks = epic.peakfinder(self.data, self.peakcutoff) peaktime = [] prettypeak = [] for i,each in enumerate(self.peaks): peaktime.append(str(self.time[each[1]])) t = self.time[each[1]] prettypeak.append(time.strftime("%H:%M:%S",time.gmtime(t))) foundpeaks = "Peaks have been found at the following times: \n %s" %(prettypeak) reply = QtGui.QMessageBox.question(self, 'Message', foundpeaks, QtGui.QMessageBox.Ok) self.ui.statusbar.showMessage('Ready')