Adjust fit-parameter handling for the polymer_fit plugin.
[hooke.git] / hooke / plugin / flatfilt.py
index 21665fecbc3e6412829deffdd39a123df69209f7..a325fccd0215a666501752aadd9c88cf6b4d77f4 100644 (file)
@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 #
-# Copyright (C) 2008-2010 Alberto Gomez-Casado
+# Copyright (C) 2008-2011 Alberto Gomez-Casado
 #                         Fabrizio Benedetti
 #                         Massimo Sandal <devicerandom@gmail.com>
 #                         W. Trevor King <wking@drexel.edu>
@@ -28,8 +28,7 @@ several associated :class:`~hooke.command.Command`\s for removing flat
 
 See Also
 --------
-:mod:`~hooke.plugin.convfilt` for a convolution-based filter for
-:class:`~hooke.experiment.VelocityClamp` experiments.
+:mod:`~hooke.plugin.convfilt` for a convolution-based filter.
 """
 
 import copy
@@ -41,7 +40,6 @@ from scipy.signal.signaltools import medfilt
 from ..command import Argument, Success, Failure, UncaughtException
 from ..config import Setting
 from ..curve import Data
-from ..experiment import VelocityClamp
 from ..util.fit import PoorFit
 from ..util.peak import (find_peaks, peaks_to_mask,
                          find_peaks_arguments, Peak, _kwargs)
@@ -170,9 +168,6 @@ Name for storing the list of peaks in the `.info` dictionary.
         deflection arrays.
         """
         curve = self._curve(hooke=hooke, params=params)
-        if not isinstance(curve.info['experiment'], VelocityClamp):
-            raise Failure('%s operates on VelocityClamp experiments, not %s'
-                          % (self.name, curve.info['experiment']))
         for key,value in params.items():
             if value == None and key in self.plugin.config:
                 # Use configured default value.
@@ -227,8 +222,7 @@ class FlatFilterCommand (FilterCommand):
         params['curve'] = curve
         inq = Queue()
         outq = Queue()
-        filt_command = [c for c in hooke.commands
-                        if c.name=='flat filter peaks'][0]
+        filt_command = hooke.command_by_name['flat filter peaks']
         filt_command.run(hooke, inq, outq, **params)
         peaks = outq.get()
         if isinstance(peaks, UncaughtException) \