[SciPy-User] rbf interpolating

Wolfgang Kerzendorf wkerzendorf at googlemail.com
Fri Mar 11 07:11:26 EST 2011


Dear all

I am currently trying to use interpolate.Rbf to interpolate my data. My 
data looks like that:

(array([  9000.,   9000.,   9000., ...,  12000.,  12000.,  12000.]),
  array([ 3.5,  3.5,  3.5, ...,  4.5,  4.5,  4.5]),
  array([-2.5, -2.5, -2.5, ...,  0.5,  0.5,  0.5]),
  array([ 150.,  150.,  150., ...,  250.,  250.,  250.]),
  array([ 0.5,  0.7,  0.9, ...,  0.9,  1.1,  1.3]),
  array([[ 0.12608476,  0.12826188,  0.13127538, ...,  0.29928203,
          0.27434822,  0.25906699],
        [ 0.06169096,  0.06278402,  0.06430721, ...,  0.44264917,
          0.40578164,  0.38318576],
        [ 0.03013017,  0.03067692,  0.03144345, ...,  0.65333767,
          0.59893744,  0.56559473],
        ...,
        [ 0.07080239,  0.07284835,  0.07565985, ...,  0.44098662,
          0.40915711,  0.39057291],
        [ 0.0345885 ,  0.03560238,  0.037001  , ...,  0.65085347,
          0.60389154,  0.57647133],
        [ 0.01686656,  0.0173676 ,  0.01806123, ...,  0.95862692,
          0.88947996,  0.84910533]]))

So the first 5 items are the coordinates. the last is the data (which is 
not only a single number but is actually a 1D array. If I do this with 
griddata it works.

I tried giving it to Rbf by doing Rbf(*data), but I get the following error:

/Library/Python/2.6/site-packages/scipy/interpolate/rbf.pyc in 
__init__(self, *args, **kwargs)
     196
     197         self.A = self._init_function(r) - eye(self.N)*self.smooth
--> 198         self.nodes = linalg.solve(self.A, self.di)
     199
     200     def _call_norm(self, x1, x2):

/Library/Python/2.6/site-packages/scipy/linalg/basic.pyc in solve(a, b, 
sym_pos, lower, overwrite_a, overwrite_b, debug)
      49         raise ValueError('expected square matrix')
      50     if a1.shape[0] != b1.shape[0]:
---> 51         raise ValueError('incompatible dimensions')
      52     overwrite_a = overwrite_a or (a1 is not a and not 
hasattr(a,'__array__'))
      53     overwrite_b = overwrite_b or (b1 is not b and not 
hasattr(b,'__array__'))

ValueError: incompatible dimensions

-----

Your help is greatly appreciated,
       Wolfgang



More information about the SciPy-User mailing list