1 # Copyright (C) 2009-2010 Rolf Schmidt <rschmidt@alcor.concordia.ca>
2 # W. Trevor King <wking@drexel.edu>
4 # This file is part of Hooke.
6 # Hooke is free software: you can redistribute it and/or
7 # modify it under the terms of the GNU Lesser General Public
8 # License as published by the Free Software Foundation, either
9 # version 3 of the License, or (at your option) any later version.
11 # Hooke is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU Lesser General Public License for more details.
16 # You should have received a copy of the GNU Lesser General Public
17 # License along with Hooke. If not, see
18 # <http://www.gnu.org/licenses/>.
20 """This plugin contains a plotmanipulator to show the convoluted curve.
25 class showconvolutedCommands:
27 #def _plug_init(self):
30 def plotmanip_showconvoluted(self, plot, curve):
32 BEGIN: taken from procplots.py
33 might need some tweaking
35 #use only for force spectroscopy experiments!
36 if curve.driver.experiment != 'smfs':
40 END: taken from procplots.py
43 #need to convert the string that contains the list into a list
44 #convolution = eval(self.config['convfilt']['convolution']['value'])
45 convolution = eval(self.GetStringFromConfig('flatfilts', 'convfilt', 'convolution'))
47 xRet = plot.vectors[1][0]
48 yRet = plot.vectors[1][1]
49 convoluted = libpeakspot.conv_dx(yRet, convolution)
50 #convoluted=libpeakspot.conv_dx(yRet, [-20, -10, -6, 0, 12, 12, 12])
51 plot.add_set(xRet, convoluted)
52 #plot.vectors[1][1]=[i for i in convoluted]
53 #set contact point plot style to 'plot'
55 plot.styles.append('plot')
56 plot.colors.append('black')
57 #peak_location, peak_size = self.has_peaks(plot, blindwindow, convolution, minpeaks)
58 peak_locations, peak_sizes = self.has_peaks(plot, curve)
63 for location in peak_locations:
64 peak_locations_x.append(xRet[location])
65 peak_locations_y.append(yRet[location])
66 plot.add_set(peak_locations_x, peak_locations_y)
67 plot.styles.append('scatter')
68 plot.colors.append('green')
69 plot.add_set(peak_locations_x, peak_sizes)
70 plot.styles.append('scatter')
71 plot.colors.append('magenta')
73 #Return the plot object.