[SciPy-user] Linear Interpolation 2

Andrea Gavana andrea.gavana@gmail....
Tue Apr 29 15:48:25 CDT 2008


Hi All,

    as I didn't get any answer, I thought I might repost with some
more analysis the trouble I am having with interp2d.

The attached script produces 3 different results depending on the
value of the parameter numColumns, i.e.:

1) numColumns = 20

Traceback (most recent call last):
  File "C:\MyProjects\LinearInterpolation.py", line 27, in <module>
    function = interp2d(xx, yy, z, kind="linear")
  File "C:\Python25\Lib\site-packages\scipy\interpolate\interpolate.py",
line 113, in __init__
    self.tck = fitpack.bisplrep(self.x, self.y, self.z, kx=kx, ky=ky, s=0.)
  File "C:\Python25\Lib\site-packages\scipy\interpolate\fitpack.py",
line 702, in bisplrep
    tx,ty,nxest,nyest,wrk,lwrk1,lwrk2)
ValueError: Invalid inputs.

2) numColumns = 200

Traceback (most recent call last):
  File "C:\MyProjects\LinearInterpolation.py", line 27, in <module>
    function = interp2d(xx, yy, z, kind="linear")
  File "C:\Python25\Lib\site-packages\scipy\interpolate\interpolate.py",
line 113, in __init__
    self.tck = fitpack.bisplrep(self.x, self.y, self.z, kx=kx, ky=ky, s=0.)
  File "C:\Python25\Lib\site-packages\scipy\interpolate\fitpack.py",
line 702, in bisplrep
    tx,ty,nxest,nyest,wrk,lwrk1,lwrk2)
MemoryError

(MemoryError? With a 372x200 matrix???)

3) numColumns = 2000

Traceback (most recent call last):
  File "C:\MyProjects\LinearInterpolation.py", line 27, in <module>
    function = interp2d(xx, yy, z, kind="linear")
  File "C:\Python25\Lib\site-packages\scipy\interpolate\interpolate.py",
line 113, in __init__
    self.tck = fitpack.bisplrep(self.x, self.y, self.z, kx=kx, ky=ky, s=0.)
  File "C:\Python25\Lib\site-packages\scipy\interpolate\fitpack.py",
line 702, in bisplrep
    tx,ty,nxest,nyest,wrk,lwrk1,lwrk2)
OverflowError: long int too large to convert to int

Is there anyone who could tell me, please, what I am doing wrong? This
is on Windows XP 1GB RAM, 3.7 GHz, Python 2.5, scipy 0.6.0, numpy
1.0.4.

Thank you for your suggestions.

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: LinearInterpolation.py
Url: http://projects.scipy.org/pipermail/scipy-user/attachments/20080429/7b84f43e/attachment-0001.pl 


More information about the SciPy-user mailing list