[Scipy-svn] r4937 - trunk/scipy/interpolate
scipy-svn at scipy.org
scipy-svn at scipy.org
Sun Nov 2 20:42:14 EST 2008
Author: ptvirtan
Date: 2008-11-02 19:42:04 -0600 (Sun, 02 Nov 2008)
New Revision: 4937
Modified:
trunk/scipy/interpolate/interpolate.py
Log:
scipy.interpolate: move interp2d.__init__ docstring to the class docstring
Modified: trunk/scipy/interpolate/interpolate.py
===================================================================
--- trunk/scipy/interpolate/interpolate.py 2008-11-03 01:41:34 UTC (rev 4936)
+++ trunk/scipy/interpolate/interpolate.py 2008-11-03 01:42:04 UTC (rev 4937)
@@ -44,56 +44,57 @@
# !! found, get rid of it!
class interp2d(object):
- """ Interpolate over a 2D grid.
-
- See Also
- --------
- bisplrep, bisplev - spline interpolation based on FITPACK
- BivariateSpline - a more recent wrapper of the FITPACK routines
"""
+ interp2d(x, y, z, kind='linear', copy=True, bounds_error=False,
+ fill_value=nan)
+
+ Interpolate over a 2D grid.
- def __init__(self, x, y, z, kind='linear', copy=True, bounds_error=False,
- fill_value=np.nan):
- """ Initialize a 2D interpolator.
+ Parameters
+ ----------
+ x : 1D array
+ y : 1D array
+ Arrays defining the coordinates of a 2D grid. If the
+ points lie on a regular grid, x and y can simply specify
+ the rows and colums, i.e.
- Parameters
- ----------
- x : 1D array
- y : 1D array
- Arrays defining the coordinates of a 2D grid. If the
- points lie on a regular grid, x and y can simply specify
- the rows and colums, i.e.
+ x = [0,1,2] y = [0,1,2]
- x = [0,1,2] y = [0,1,2]
+ otherwise x and y must specify the full coordinates, i.e.
- otherwise x and y must specify the full coordinates, i.e.
+ x = [0,1,2,0,1.5,2,0,1,2] y = [0,1,2,0,1,2,0,1,2]
- x = [0,1,2,0,1.5,2,0,1,2] y = [0,1,2,0,1,2,0,1,2]
+ If x and y are 2-dimensional, they are flattened (allowing
+ the use of meshgrid, for example).
- If x and y are 2-dimensional, they are flattened (allowing
- the use of meshgrid, for example).
+ z : 1D array
+ The values of the interpolated function on the grid
+ points. If z is a 2-dimensional array, it is flattened.
- z : 1D array
- The values of the interpolated function on the grid
- points. If z is a 2-dimensional array, it is flattened.
+ kind : 'linear', 'cubic', 'quintic'
+ The kind of interpolation to use.
+ copy : bool
+ If True, then data is copied, otherwise only a reference is held.
+ bounds_error : bool
+ If True, when interoplated values are requested outside of the
+ domain of the input data, an error is raised.
+ If False, then fill_value is used.
+ fill_value : number
+ If provided, the value to use for points outside of the
+ interpolation domain. Defaults to NaN.
- kind : 'linear', 'cubic', 'quintic'
- The kind of interpolation to use.
- copy : bool
- If True, then data is copied, otherwise only a reference is held.
- bounds_error : bool
- If True, when interoplated values are requested outside of the
- domain of the input data, an error is raised.
- If False, then fill_value is used.
- fill_value : number
- If provided, the value to use for points outside of the
- interpolation domain. Defaults to NaN.
+ Raises
+ ------
+ ValueError when inputs are invalid.
- Raises
- ------
- ValueError when inputs are invalid.
+ See Also
+ --------
+ bisplrep, bisplev - spline interpolation based on FITPACK
+ BivariateSpline - a more recent wrapper of the FITPACK routines
+ """
- """
+ def __init__(self, x, y, z, kind='linear', copy=True, bounds_error=False,
+ fill_value=np.nan):
self.x, self.y, self.z = map(ravel, map(array, [x, y, z]))
if not map(rank, [self.x, self.y, self.z]) == [1,1,1]:
raise ValueError("One of the input arrays is not 1-d.")
More information about the Scipy-svn
mailing list