#-----Convolution-based peak recognition and filtering.
#Requires the libpeakspot.py library
- def has_peaks(self, plot, abs_devs):
+ def has_peaks(self, plot, abs_devs=None):
'''
Finds peak position in a force curve.
FIXME: should be moved in libpeakspot.py
'''
+ if abs_devs==None:
+ abs_devs=self.convfilt_config['mindeviation']
+
+
xret=plot.vectors[1][0]
yret=plot.vectors[1][1]
#Calculate convolution.
#do the dirty convolution-peak finding stuff
noise_level=lps.noise_absdev(convoluted[cut_index:], self.convfilt_config['positive'], self.convfilt_config['maxcut'], self.convfilt_config['stable'])
above=lps.abovenoise(convoluted,noise_level,cut_index,abs_devs)
- peak_location,peak_size=lps.find_peaks(above)
+ peak_location,peak_size=lps.find_peaks(above,seedouble=self.convfilt_config['seedouble'])
#take the maximum
for i in range(len(peak_location)):
try:
abs_devs=float(args)
except:
- pass
+ print 'Wrong argument, using config value'
+ abs_devs=float(self.convfilt_config['mindeviation'])
defplots=self.current.curve.default_plots()[0] #we need the raw, uncorrected plots
recplot.vectors.append([xgood,ygood])
if recplot.styles==[]:
recplot.styles=[None,None,'scatter']
+ recplot.colors=[None,None,None]
else:
recplot.styles+=['scatter']
+ recplot.colors+=[None]
self._send_plot([recplot])