[SciPy-User] SmoothBivariateSpline returns always zeros!

nicoletti nicoletti at consorzio-innova.it
Fri Sep 25 04:20:00 EDT 2009


Dear all,

 I have tried to use the class SmoothBivariateSpline, but it seems to me
 that it returns always zeros. I attach the output and the script file.


 {{{
 >python -u "bspline.py"
 /usr/lib/python2.5/site-packages/scipy/interpolate/fitpack.py:763:
 DeprecationWarning: integer argument expected, got float
   tx,ty,nxest,nyest,wrk,lwrk1,lwrk2)
 /usr/lib/python2.5/site-packages/scipy/interpolate/fitpack2.py:439:
 UserWarning: ier=1368
   warnings.warn(message)
 [[-2.89772727 -2.86668909 -2.83510787 ...,  0.65215576  0.67305161
    0.69318182]
  [-2.87406809 -2.84319518 -2.81177699 ...,  0.67025301  0.69120171
    0.71138701]
  [-2.85038278 -2.81967401 -2.78841772 ...,  0.68848547  0.70948813
    0.72972964]
  ...,
  [-0.72972964 -0.70948813 -0.68848547 ...,  2.78841772  2.81967401
    2.85038278]
  [-0.71138701 -0.69120171 -0.67025301 ...,  2.81177699  2.84319518
    2.87406809]
  [-0.69318182 -0.67305161 -0.65215576 ...,  2.83510787  2.86668909
    2.89772727]] [[ 0.  0.  0. ...,  0.  0.  0.]
  [ 0.  0.  0. ...,  0.  0.  0.]
  [ 0.  0.  0. ...,  0.  0.  0.]
  ...,
  [ 0.  0.  0. ...,  0.  0.  0.]
  [ 0.  0.  0. ...,  0.  0.  0.]
  [ 0.  0.  0. ...,  0.  0.  0.]]
 >Exit code: 1    Time: 1,221

 }}}


*File python script bspline.py:*
from numpy import *
import scipy
from enthought.chaco.shell import *
from scipy import ndimage
import numpy
from scipy import interpolate

x= numpy.linspace(-2,2,80)
y = numpy.linspace(-2,2,80)
z = x+ y
xi= numpy.linspace(-1,1,100)
yi = numpy.linspace(-2,2,100)

tck = interpolate.bisplrep(x,y,z)
res1 = interpolate.bisplev(xi,yi,tck)

interp_ = interpolate.SmoothBivariateSpline(x,y,z,kx=5,ky=5)
res2 = interp_(xi,yi)

print res1, res2

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.scipy.org/pipermail/scipy-user/attachments/20090925/939b283a/attachment.html>


More information about the SciPy-User mailing list