Ejemplo n.º 1
0
Archivo: spline_.py Proyecto: nmik/Xgam
 def __init__(self,
              x,
              y,
              z,
              kx=1,
              ky=1,
              xname=None,
              xunits=None,
              yname=None,
              yunits=None,
              zname=None,
              zunits=None):
     """Constructor.
     """
     if hasattr(z, '__call__'):
         _x, _y = numpy.meshgrid(y, x)
         z = z(_x, _y)
     xBivariateSplineBase.__init__(self, x, y, z, xname, xunits, yname,
                                   yunits, zname, zunits)
     RectBivariateSpline.__init__(self,
                                  x,
                                  y,
                                  z,
                                  bbox=[None, None, None, None],
                                  kx=kx,
                                  ky=ky,
                                  s=0)
Ejemplo n.º 2
0
 def __init__(self, xgrid, ygrid, zgrid, xbins=None, *args, **kwargs):
     self.xbins = xbins
     RectBivariateSpline.__init__(self, xgrid, ygrid, zgrid, *args,
                                  **kwargs)
     xknots, yknots = self.get_knots()
     self.xmin, self.xmax = np.min(xknots), np.max(xknots)
     self.ymin, self.ymax = np.min(yknots), np.max(yknots)
Ejemplo n.º 3
0
 def __init__(self, x, y, z, kx=1, ky=1, xname=None, xunits=None,
              yname=None, yunits=None, zname=None, zunits=None):
     """Constructor.
     """
     if hasattr(z, '__call__'):
         _x, _y = numpy.meshgrid(y, x)
         z = z(_x, _y)
     xBivariateSplineBase.__init__(self, x, y, z, xname, xunits, yname,
                                   yunits, zname, zunits)
     RectBivariateSpline.__init__(self, x, y, z,
                                  bbox=[None, None, None, None],
                                  kx=kx, ky=ky, s=0)
Ejemplo n.º 4
0
    def __init__(self, *args, **kw):
        data = kw.pop('data', None)
        if data is None:
            RectBivariateSpline.__init__(self, *args, **kw)
        else:
            self.tck = data['tck']
            self.degrees = data['degrees']

        # predefine workspaces for fast 1-point evaluation
        kx, ky = self.degrees
        self.wrk1 = np.zeros(kx + ky + 2)
        self.iwrk1 = np.zeros(2, 'i')
        self.z1 = np.zeros(1)
Ejemplo n.º 5
0
 def __init__(self, x, y, z, fill_value=0.0, **kwargs):
     self.xbnds = [x[0], x[-1]]
     self.ybnds = [y[0], y[-1]]
     self.fill_value = fill_value
     RectBivariateSpline.__init__(self, x, y, z, **kwargs)
Ejemplo n.º 6
0
 def _initSpline(self):
     RectBivariateSpline.__init__(self, self.x, self.y, self.P.T, s=0)
     self.spl = self
Ejemplo n.º 7
0
 def _initSpline(self):
     RectBivariateSpline.__init__(self, self.x, self.y, self.P.T, s=0)
     self.spl = self
Ejemplo n.º 8
0
 def __init__(self, x, y, z, fill_value=0.0, **kwargs):
     self.xbnds = [x[0], x[-1]]
     self.ybnds = [y[0], y[-1]]
     self.fill_value = fill_value
     RectBivariateSpline.__init__(self, x, y, z, **kwargs)