peak_location, peak_size = find_current_peaks()
+ if len(peak_location) == 0:
+ print 'No peaks to fit.'
+ return
+
fitplot=copy.deepcopy(displayed_plot)
#Pick up force baseline
#-----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.
Syntax: next, n
'''
def do_next(self,args):
- self.current.curve.close_all()
+ try:
+ self.current.curve.close_all()
+ except:
+ print 'No curve file loaded, currently!'
+ print 'This should not happen, report to http://code.google.com/p/hooke'
+ return
+
if self.pointer == (len(self.current_list)-1):
self.pointer=0
print 'Playlist finished; back to first curve.'
Syntax: previous, p
'''
def do_previous(self,args):
- self.current.curve.close_all()
+ try:
+ self.current.curve.close_all()
+ except:
+ print 'No curve file loaded, currently!'
+ print 'This should not happen, report to http://code.google.com/p/hooke'
+ return
if self.pointer == 0:
self.pointer=(len(self.current_list)-1)
print 'Start of playlist; jump to last curve.'