[Scipy-svn] r2582 - trunk/Lib/signal

scipy-svn at scipy.org scipy-svn at scipy.org
Sat Jan 20 23:05:34 CST 2007


Author: rkern
Date: 2007-01-20 23:05:33 -0600 (Sat, 20 Jan 2007)
New Revision: 2582

Modified:
   trunk/Lib/signal/filter_design.py
Log:
Add workaround for 0-d arrays being passed to lp2lp and lp2hp.

Modified: trunk/Lib/signal/filter_design.py
===================================================================
--- trunk/Lib/signal/filter_design.py	2007-01-19 07:34:09 UTC (rev 2581)
+++ trunk/Lib/signal/filter_design.py	2007-01-21 05:05:33 UTC (rev 2582)
@@ -182,8 +182,11 @@
     from a low-pass filter prototype with unity cutoff frequency.
     """
     a,b = map(atleast_1d,(a,b))
+    # fixme: this test is not terribly reliable in the face of 0-d arrays which
+    # tend to get passed in. However, using .flat should work around that
+    # problem.
     if type(wo) is type(a):
-        wo = wo[0]
+        wo = wo.flat[0]
     wo = float(wo)
     d = len(a)
     n = len(b)
@@ -200,8 +203,11 @@
     from a low-pass filter prototype with unity cutoff frequency.
     """
     a,b = map(atleast_1d,(a,b))
+    # fixme: this test is not terribly reliable in the face of 0-d arrays which
+    # tend to get passed in. However, using .flat should work around that
+    # problem.
     if type(wo) is type(a):
-        wo = wo[0]
+        wo = wo.flat[0]
     d = len(a)
     n = len(b)
     if wo != 1:



More information about the Scipy-svn mailing list