1 #!/usr/bin/env python
\r
4 SHOW CONVOLUTED CURVE PLUGIN FOR HOOKE
\r
6 This plugin contains a plotmanipulator to show the convoluted curve.
\r
7 (c) Dr. Rolf Schmidt, 2009
\r
12 class showconvolutedCommands:
\r
14 #def _plug_init(self):
\r
17 def plotmanip_showconvoluted(self, plot, curve):
\r
19 BEGIN: taken from procplots.py
\r
20 might need some tweaking
\r
22 #use only for force spectroscopy experiments!
\r
23 if curve.driver.experiment != 'smfs':
\r
27 END: taken from procplots.py
\r
30 #need to convert the string that contains the list into a list
\r
31 #convolution = eval(self.config['convfilt']['convolution']['value'])
\r
32 convolution = eval(self.GetStringFromConfig('flatfilts', 'convfilt', 'convolution'))
\r
34 xRet = plot.vectors[1][0]
\r
35 yRet = plot.vectors[1][1]
\r
36 convoluted = libpeakspot.conv_dx(yRet, convolution)
\r
37 #convoluted=libpeakspot.conv_dx(yRet, [-20, -10, -6, 0, 12, 12, 12])
\r
38 plot.add_set(xRet, convoluted)
\r
39 #plot.vectors[1][1]=[i for i in convoluted]
\r
40 #set contact point plot style to 'plot'
\r
41 #and the color to red
\r
42 plot.styles.append('plot')
\r
43 plot.colors.append('black')
\r
44 #peak_location, peak_size = self.has_peaks(plot, blindwindow, convolution, minpeaks)
\r
45 peak_locations, peak_sizes = self.has_peaks(plot, curve)
\r
48 peak_locations_x = []
\r
49 peak_locations_y = []
\r
50 for location in peak_locations:
\r
51 peak_locations_x.append(xRet[location])
\r
52 peak_locations_y.append(yRet[location])
\r
53 plot.add_set(peak_locations_x, peak_locations_y)
\r
54 plot.styles.append('scatter')
\r
55 plot.colors.append('green')
\r
56 plot.add_set(peak_locations_x, peak_sizes)
\r
57 plot.styles.append('scatter')
\r
58 plot.colors.append('magenta')
\r
60 #Return the plot object.
\r