[SciPy-User] Swapped axis of interpolate.bisplev

Ronald Römer rroemer at gmail.com
Wed Jan 29 09:42:31 EST 2014


Hello,

I have a simple question about the bisplrep-function. Here is my example:

=====

Python 2.7.1 (r271:86832, Apr 12 2011, 16:15:16)
[GCC 4.6.0 20110331 (Red Hat 4.6.0-2)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
>>> from scipy import interpolate

>>> x = [[0.00044999999999999999, 0.0013500000000000001,
0.0022499999999999998, 0.00315],
...  [0.00044999999999999999, 0.0013500000000000001, 0.0022499999999999998,
0.00315],
...  [0.00044999999999999999, 0.0013500000000000001, 0.0022499999999999998,
0.00315],
...  [0.00044999999999999999, 0.0013500000000000001, 0.0022499999999999998,
0.00315]]

>>> y = [[0.00044999999999999999, 0.00044999999999999999,
0.00044999999999999999, 0.00044999999999999999],
...  [0.0013500000000000001, 0.0013500000000000001, 0.0013500000000000001,
0.0013500000000000001],
...  [0.0022499999999999998, 0.0022499999999999998, 0.0022499999999999998,
0.0022499999999999998],
...  [0.00315, 0.00315, 0.00315, 0.00315]]

>>> r = [[354532.60790243, 549112.50964666996, 753454.90521641006,
136672.17168719001],
...  [262992.88639023999, 126681.69270699999, -171772.44189881999,
-705770.91541941999],
...  [261424.75081678, 125749.32400532, -177467.12005669001,
-730048.73154369998],
...  [350700.67623087001, 542821.56886627001, 734994.61649696995,
87886.793706120006]]

>>> ipl = interpolate.bisplrep(x, y, r)

>>> interpolate.bisplev(x[0], [ yi[0] for yi in y ], ipl)
array([[ 354532.60790243,  262992.88639024,  261424.75081678,
         350700.67623087],
       [ 549112.50964667,  126681.692707  ,  125749.32400532,
         542821.56886627],
       [ 753454.90521641, -171772.44189882, -177467.12005669,
         734994.61649697],
       [ 136672.17168719, -705770.91541942, -730048.7315437 ,
          87886.79370612]])
>>>

=====

And now the question: Why is the last output not equivalent to r? It seems
so, as if the x- and y-axis are swapped. Whats the reason for that issue?

Best regards.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.scipy.org/pipermail/scipy-user/attachments/20140129/e01edc7c/attachment.html>


More information about the SciPy-User mailing list