Package PyDSTool :: Module common :: Class interp1d
[hide private]
[frames] | no frames]

Class interp1d

source code

 object --+    
          |    
interpclass --+
              |
             interp1d

Instance Methods [hide private]
 
__init__(self, x, y, kind='linear', axis=-1, makecopy=0, bounds_error=1, fill_value=None)
Initialize a 1d piecewise-linear interpolation class
source code
 
__call__(self, x_new)
Find linearly interpolated y_new = <name>(x_new).
source code
 
_check_bounds(self, x_new) source code
 
__getstate__(self) source code
 
__setstate__(self, state) source code

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Class Variables [hide private]

Inherited from interpclass: interp_axis

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, x, y, kind='linear', axis=-1, makecopy=0, bounds_error=1, fill_value=None)
(Constructor)

source code 
Initialize a 1d piecewise-linear interpolation class

Description:
  x and y are arrays of values used to approximate some function f:
    y = f(x)
  This class returns a function whose call method uses linear
  interpolation to find the value of new points.

Inputs:
    x -- a 1d array of monotonically increasing real values.
         x cannot include duplicate values. (otherwise f is
         overspecified)
    y -- an nd array of real values.  y's length along the
         interpolation axis must be equal to the length
         of x.
    kind -- specify the kind of interpolation: 'nearest', 'linear',
            'cubic', or 'spline'
    axis -- specifies the axis of y along which to
            interpolate. Interpolation defaults to the last
            axis of y.  (default: -1)
    makecopy -- If 1, the class makes internal copies of x and y.
            If 0, references to x and y are used. The default
            is NOT to copy. (default: 0)
    bounds_error -- If 1, an error is thrown any time interpolation
                    is attempted on a value outside of the range
                    of x (where extrapolation is necessary).
                    If 0, out of bounds values are assigned the
                    NaN (#INF) value.  By default, an error is
                    raised, although this is prone to change.
                    (default: 1)

Overrides: object.__init__

__call__(self, x_new)
(Call operator)

source code 
Find linearly interpolated y_new = <name>(x_new).

Inputs:
  x_new -- New independent variables.

Outputs:
  y_new -- Linearly interpolated values corresponding to x_new.