[Scipy-svn] r2244 - trunk/Lib/interpolate

scipy-svn at scipy.org scipy-svn at scipy.org
Sat Oct 7 11:32:04 EDT 2006


Author: stefan
Date: 2006-10-07 10:31:49 -0500 (Sat, 07 Oct 2006)
New Revision: 2244

Modified:
   trunk/Lib/interpolate/interpolate.py
Log:
In interp2d, ensure that the argument passed to bisplrep is a meshgrid.


Modified: trunk/Lib/interpolate/interpolate.py
===================================================================
--- trunk/Lib/interpolate/interpolate.py	2006-10-07 13:34:06 UTC (rev 2243)
+++ trunk/Lib/interpolate/interpolate.py	2006-10-07 15:31:49 UTC (rev 2244)
@@ -8,7 +8,7 @@
 
 from numpy import shape, sometrue, rank, array, transpose, \
      swapaxes, searchsorted, clip, take, ones, putmask, less, greater, \
-     logical_or, atleast_1d, atleast_2d
+     logical_or, atleast_1d, atleast_2d, meshgrid
 import numpy as np
 
 import fitpack
@@ -55,10 +55,12 @@
         ------
         ValueError when inputs are invalid.
 
-        """
-
+        """        
         self.x = atleast_1d(x).copy()
         self.y = atleast_1d(y).copy()
+        if rank(self.x) == 1 and rank(self.y) == 1:
+            # Prepare meshgrid for bisplrep
+            x, y = meshgrid(x,y)        
         if rank(self.x) > 2 or rank(self.y) > 2:
             raise ValueError("One of the input arrays is not 1-d or 2-d.")
         if rank(self.x) == 2:




More information about the Scipy-svn mailing list