[Scipy-svn] r3222 - in trunk/Lib/signal: . tests

scipy-svn@scip... scipy-svn@scip...
Tue Aug 7 18:56:22 CDT 2007


Author: stefan
Date: 2007-08-07 18:55:56 -0500 (Tue, 07 Aug 2007)
New Revision: 3222

Modified:
   trunk/Lib/signal/signaltools.py
   trunk/Lib/signal/tests/test_signaltools.py
Log:
Fix order_filter.


Modified: trunk/Lib/signal/signaltools.py
===================================================================
--- trunk/Lib/signal/signaltools.py	2007-08-05 14:50:56 UTC (rev 3221)
+++ trunk/Lib/signal/signaltools.py	2007-08-07 23:55:56 UTC (rev 3222)
@@ -157,7 +157,7 @@
 
     return sigtools._correlateND(volume,kernel[slice_obj],val)
 
-def order_filter(a, domain, order):
+def order_filter(a, domain, rank):
     """Perform an order filter on an N-dimensional array.
 
   Description:
@@ -188,7 +188,7 @@
     for k in range(len(size)):
         if (size[k] % 2) != 1:
             raise ValueError, "Each dimension of domain argument should have an odd number of elements."
-    return sigtools._orderfilterND(a, domain, rank)
+    return sigtools._order_filterND(a, domain, rank)
 
 
 def medfilt(volume,kernel_size=None):

Modified: trunk/Lib/signal/tests/test_signaltools.py
===================================================================
--- trunk/Lib/signal/tests/test_signaltools.py	2007-08-05 14:50:56 UTC (rev 3221)
+++ trunk/Lib/signal/tests/test_signaltools.py	2007-08-07 23:55:56 UTC (rev 3222)
@@ -40,6 +40,10 @@
         # make sure interpolated values are on knot points
         assert_array_almost_equal(y2[::10], y, decimal=5)
 
+class test_order_filt(NumpyTestCase):
+    def check_basic(self):
+        assert_array_equal(signal.order_filter([1,2,3],[1,0,1],1),
+                           [2,3,2])
 
 if __name__ == "__main__":
     NumpyTest().run()



More information about the Scipy-svn mailing list