Close parenthesis on column append in DifferenceCommand
[hooke.git] / hooke / plugin / multidistance.py
index 517a286ad638aa66b5379ec3c7571b019c3883f7..7c8291ac4135680619a098ac28d779a77c4033bc 100644 (file)
@@ -1,5 +1,24 @@
-# -*- coding: utf-8 -*-
-from libhooke import WX_GOOD, ClickedPoint
+# Copyright (C) 2009-2010 Fabrizio Benedetti
+#                         W. Trevor King <wking@drexel.edu>
+#
+# This file is part of Hooke.
+#
+# Hooke is free software: you can redistribute it and/or modify it
+# under the terms of the GNU Lesser General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# Hooke is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+# or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General
+# Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with Hooke.  If not, see
+# <http://www.gnu.org/licenses/>.
+
+from hooke.libhooke import WX_GOOD, ClickedPoint
+
 import wxversion
 wxversion.select(WX_GOOD)
 from wx import PostEvent
@@ -31,27 +50,10 @@ class multidistanceCommands(object):
      deviation = number of times the convolution signal is above the noise absolute deviation.
      '''
 
-     def find_current_peaks(noflatten, a):
-            #Find peaks.
-           if len(a)==0:
-                 a=self.convfilt_config['mindeviation']
-            try:
-                 abs_devs=float(a)
-            except:
-                print "Bad input, using default."
-                 abs_devs=self.convfilt_config['mindeviation']
-
-            defplot=self.current.curve.default_plots()[0]
-            if not noflatten:
-                flatten=self._find_plotmanip('flatten') #Extract flatten plotmanip
-                defplot=flatten(defplot, self.current, customvalue=1) #Flatten curve before feeding it to has_peaks
-            pk_loc,peak_size=self.has_peaks(defplot, abs_devs)
-            return pk_loc, peak_size
-
-
+      
      noflatten=False
-     peaks_location, peak_size=find_current_peaks(noflatten, args)
-
+     peaks_location, peak_size=self.find_current_peaks(noflatten)
+     
      #if no peaks, we have nothing to plot. exit.
      if len(peaks_location)==0:
             return