interp2d raises AttributeError: interp2d instance has no attribute 'tck', scipy 0.4.8, numpy 0.9.6
![](https://secure.gravatar.com/avatar/97b0d7c081c6f877159c3ee17ba85c45.jpg?s=120&d=mm&r=g)
Hi, The following program raises an AttributeError file: testinterp2d.py ==== from scipy.interpolate.interpolate import interp2d from numpy import * X, Y = mgrid[0:3, 0:3] Z = X * Y ip = interp2d( X, Y, Z ) ip( 0.5, 0.5 ) ==== # python testinterp2d.py Traceback (most recent call last): File "testinterp2d.py", line 9, in ? ip( 0.5, 0.5 ) File "/home/albert/local/lib/python2.4/site-packages/scipy/interpolate/interpolate.py", line 64, in __call__ z,ier=fitpack._fitpack._bispev(*(self.tck+[x,y,dx,dy])) AttributeError: interp2d instance has no attribute 'tck' ==== This is on scipy 0.4.8, numpy 0.9.6, Ubuntu 5.10, python 2.4 Am I not using interp2d correctly? Thanks, -albert
![](https://secure.gravatar.com/avatar/569e17de9c52ad515e3543b4802f86b1.jpg?s=120&d=mm&r=g)
as far as i know, interp2d is not implemented. There is some skeleton code, but is not finished. See http://projects.scipy.org/scipy/scipy/browser/trunk/Lib/interpolate/interpol... i have a pure python implementation of interpn that may be useful for you at http://www.scipy.org/PauGargallo/Interpolation it is probably very buggy, but seems to work. if you want more sophisticated, accurate or fast interpolation you will have to use the fitpack wrappings directly. Are there any plans for reviewing the interpolate package? Something like the 'interpolation review week'? pau On 4/13/06, Albert Huang <albert@csail.mit.edu> wrote:
Hi,
The following program raises an AttributeError
file: testinterp2d.py ==== from scipy.interpolate.interpolate import interp2d from numpy import *
X, Y = mgrid[0:3, 0:3] Z = X * Y ip = interp2d( X, Y, Z ) ip( 0.5, 0.5 )
==== # python testinterp2d.py Traceback (most recent call last): File "testinterp2d.py", line 9, in ? ip( 0.5, 0.5 ) File "/home/albert/local/lib/python2.4/site-packages/scipy/interpolate/interpolate.py", line 64, in __call__ z,ier=fitpack._fitpack._bispev(*(self.tck+[x,y,dx,dy])) AttributeError: interp2d instance has no attribute 'tck'
==== This is on scipy 0.4.8, numpy 0.9.6, Ubuntu 5.10, python 2.4
Am I not using interp2d correctly?
Thanks, -albert
_______________________________________________ SciPy-user mailing list SciPy-user@scipy.net http://www.scipy.net/mailman/listinfo/scipy-user
![](https://secure.gravatar.com/avatar/af6c39d6943bd4b0e1fde23161e7bb8c.jpg?s=120&d=mm&r=g)
On Thu, Apr 13, 2006 at 10:36:02AM +0200, Pau Gargallo wrote:
as far as i know, interp2d is not implemented. There is some skeleton code, but is not finished. See http://projects.scipy.org/scipy/scipy/browser/trunk/Lib/interpolate/interpol...
i have a pure python implementation of interpn that may be useful for you at http://www.scipy.org/PauGargallo/Interpolation it is probably very buggy, but seems to work.
if you want more sophisticated, accurate or fast interpolation you will have to use the fitpack wrappings directly.
Are there any plans for reviewing the interpolate package? Something like the 'interpolation review week'?
I filed a ticket at http://projects.scipy.org/scipy/scipy/ticket/195 linking to the previous threads, patches and to Pau's implementation. Regards Stéfan
participants (3)
-
Albert Huang
-
Pau Gargallo
-
Stefan van der Walt