[SciPy-user] Fitpack: SystemError: error return without exception set

Grant Edwards grante at visi.com
Fri Nov 19 09:42:02 CST 2004


I'm trying to fit a b-spline surface to a set of 64 points, and
I'm getting the following error:

    $ python testit.py
     iopt,kx,ky,m= 0 3 3 64
     nxest,nyest,nmax= 9 9 9
     lwrk1,lwrk2,kwrk= 1682 571 68
     xb,xe,yb,ye=  3.  21.  5695.27  175898.35
     eps,s  1.E-16  52.6862915
    Traceback (most recent call last):
      File "testit.py", line 9, in ?
        tck = interpolate.bisplrep(x,y,z)
      File
    "/usr/lib/python2.3/site-packages/scipy/interpolate/fitpack.py",
    line 611, in bisplrep
        tx,ty,nxest,nyest,wrk,lwrk1,lwrk2)
    SystemError: error return without exception set

Can anybody shed any light on the possible source of this
error?  I've ordered a copy of Dierckx's book, but it won't be
here for a week or two.

Here's my source code:

------------------------------8<------------------------------
import sys,Gnuplot
from scipy import *

d = array(map(float,file('foo.data','r').read().split()))
d.shape = (-1,3)

x,y,z = d[:,0],d[:,1],d[:,2]

tck = interpolate.bisplrep(x,y,z)

xn,yn = mgrid[min(x):max(x):50j,min(y):max(y):50j]
zn = interpolate.bisplev(xn[:,0],yn[0,:],tck)

gp = Gnuplot.Gnuplot()
gp.set_label("xlabel","x")
gp.set_label("ylabel","y")
gp.set_label("zlabel","z")
gp.splot(Gnuplot.Data(x,y,z,with='points'),
         Gnuplot.GridData(zn,xn[:,0],yn[0,:],with='lines'))
sys.stdin.readline()         
------------------------------8<------------------------------

foo.data looks like this:

    3.00   5695.270    0.390
    3.00   9073.820    0.400
    3.00  17216.820    0.430
    3.00  23477.480    0.450
    3.00  34757.700    0.470
    3.00  62282.540    0.490
    3.00 111602.470    0.520
    3.00 174409.030    0.540
    4.50   6115.870    0.520
    4.50   9646.110    0.530
    4.50  16044.670    0.540
    4.50  23380.950    0.550
    4.50  32013.490    0.560
    4.50  63247.840    0.600
    4.50 113898.510    0.620
    4.50 175822.500    0.630
    6.00   6171.030    0.600
    6.00  10149.440    0.600
    6.00  18292.440    0.620
    6.00  25897.620    0.630
    6.00  34288.840    0.650
    6.00  64688.890    0.680
    6.00 113843.350    0.700
    6.00 177980.640    0.700
    9.00   4895.450    0.640
    9.00   9742.640    0.660
    9.00  15906.770    0.680
    9.00  23422.320    0.700
    9.00  32082.440    0.710
    9.00  62475.600    0.730
    9.00 109375.390    0.740
    9.00 171147.690    0.750
   12.00   4998.880    0.700
   12.00   9080.720    0.720
   12.00  15920.560    0.730
   12.00  22312.220    0.750
   12.00  31048.190    0.750
   12.00  63633.960    0.770
   12.00 112036.860    0.770
   12.00 185647.880    0.760
   15.00   5164.360    0.710
   15.00   9832.270    0.740
   15.00  16685.900    0.760
   15.00  23711.910    0.760
   15.00  34840.440    0.770
   15.00  62489.390    0.780
   15.00 110044.200    0.790
   15.00 177546.250    0.790
   18.00   5364.310    0.720
   18.00   9797.800    0.750
   18.00  15934.350    0.760
   18.00  22725.920    0.770
   18.00  31820.430    0.780
   18.00  61241.390    0.780
   18.00 110382.060    0.790
   18.00 173788.480    0.800
   21.00   5198.830    0.730
   21.00   9728.850    0.770
   21.00  15844.710    0.780
   21.00  23560.220    0.780
   21.00  32275.500    0.790
   21.00  63151.310    0.800
   21.00 110630.280    0.800
   21.00 175898.350    0.810


-- 
Grant Edwards
grante at visi.com



More information about the SciPy-user mailing list