def __init__ (   self,
  x,
  y,
  lowerSlope = None,
  upperSlope = None,
  XConversions = None,
  YConversions = None,
  cubic_spline = True 
)

create the InterpolatingFunction

Parameters:
x the array of abscissas
y the array of ordinates
lowerSlope if not None, the slope at the lower end of the spline. If None, use 'natural' spline with zero second derivative
upperSlope if not None, the slope at the lower end of the spline. If None, use 'natural' spline with zero second derivative
XConversions a list of functions used for transforming the abscissa
YConversions a list of functions used for tranforming the ordinate
cubic_spline is true for a normal cubic spline, false for piecewise linear interpolation

Definition at line 1129 of file C2Functions.py.

01129                                                                                                                        :
01130         C2Function.__init__(self) #just on general principle, right now this does nothing
01131         self.SetDomain(min(x), max(x))
01132         self.Xraw=_numeric.array(x) #keep a private copy
01133         self.xInverted=False
01134         
01135         if YConversions is not None: self.YConversions=YConversions #inherit from class if not passed       
01136         if self.YConversions is None:
01137             self.fYin, self.fYinP, self.fYinPP, self.fYout = self.YConversions = _identity, _one, _zero, _identity
01138             self.yNonLin=False
01139             F=self.F=_numeric.array(y)
01140         else:
01141             self.fYin, self.fYinP, self.fYinPP, self.fYout = self.YConversions
01142             self.yNonLin=True
01143             self.F=_numeric.array([self.fYin(q) for q in y])
01144             if lowerSlope is not None: lowerSlope *= self.fYinP(y[0])
01145             if upperSlope is not None: upperSlope *= self.fYinP(y[-1])
01146 
01147         if XConversions is not None: self.XConversions=XConversions #inherit from class if not passed       
01148         if self.XConversions is None:
01149             self.fXin, self.fXinP, self.fXinPP, self.fXout = self.XConversions =  _identity, _one, _zero, _identity
01150             self.xNonLin=False
01151             self.X=_numeric.array(x)
01152         else:
01153             self.fXin, self.fXinP, self.fXinPP, self.fXout = self.XConversions
01154             self.xNonLin=True
01155             self.X=_numeric.array([self.fXin(q) for q in x])
01156             if lowerSlope is not None: lowerSlope /= self.fXinP(x[0])
01157             if upperSlope is not None: upperSlope /= self.fXinP(x[-1])
01158 
01159             if self.X[0] > self.X[-1]: #make sure our transformed X array is increasing
01160                 self.Xraw=self.Xraw[::-1]
01161                 self.X=self.X[::-1]
01162                 self.F=self.F[::-1]
01163                 self.xInverted=True
01164                 lowerSlope, upperSlope=upperSlope, lowerSlope
01165                     
01166         dx=self.X[1:]-self.X[:-1]
01167         if min(dx) <  0 or min(self.X) < self.X[0] or max(self.X) > self.X[-1]:
01168             raise C2Exception("monotonicity error in X values for interpolating function: "  + 
01169                 _numeric.array_str(self.X))
01170         if cubic_spline:
01171             self.y2=_spline(self.X, self.F, yp1=lowerSlope, ypn=upperSlope)
01172         else:
01173             #use a dummy y2 table if we are not really cubic splining
01174             self.y2=_numeric.zeros(len(self.X), _numeric_float)
    ##


Generated on Wed Nov 21 10:18:32 2007 for analysis by  doxygen 1.5.4