[SciPy-user] spline interpolation crashes
Martin Höfling
martin.hoefling at gmx.de
Thu Nov 2 09:36:31 EST 2006
Hi there, spline interpolation crashes, any ideas why?
Code:
print "X-Data:",xdata[i]
print "Z-Data:",zdata[i]
print "X-len:",len(xdata[i]),"Y-len:",len(zdata[i])
spl= interpolate.splrep(xdata[i],zdata[i],s=0)
Output:
X-Data: [0.0, 0.0, 0.029562700000000001, 0.22792699999999999,
0.34910819999999998, 0.42786099999999999, 0.48451450000000001,
0.55856099999999997, 0.60315879999999999, 0.65115970000000001,
0.68437389999999998, 0.72162850000000001, 0.75135989999999997,
0.77506770000000003, 0.80289730000000004, 0.83150520000000006,
0.85739379999999998, 0.88429639999999998, 0.91221640000000004,
0.93957599999999997, 0.96496970000000004, 0.98706870000000002, 1.014197,
1.032613, 1.058252, 1.0792649999999999, 1.1032379999999999, 1.121642,
1.1511579999999999, 1.1686479999999999, 1.2012400000000001,
1.2218340000000001, 1.256894, 1.28694, 1.325361, 1.3753089999999999,
1.442094, 1.55348, 1.7424329999999999, 1.9051370000000001,
2.0341550000000002, 2.1731690000000001, 2.2767909999999998,
2.3629389999999999, 2.5198740000000002, 2.66404, 3.1028980000000002]
Z-Data: [3.3134420000000002, 3.3134420000000002, 3.4199139999999999,
3.4459559999999998, 3.386771, 3.3602590000000001, 3.4568409999999998,
3.4953630000000002, 3.430307, 3.5164420000000001, 3.4472040000000002,
3.5181369999999998, 3.5190459999999999, 3.497598, 3.5216970000000001,
3.4239459999999999, 3.5243159999999998, 3.4359109999999999,
3.4631639999999999, 3.4446159999999999, 3.442116, 3.4700959999999998,
3.4670070000000002, 3.4508700000000001, 3.4703179999999998,
3.4704109999999999, 3.4184060000000001, 3.5128870000000001,
3.4097680000000001, 3.472267, 3.4288910000000001, 3.413878,
3.4225919999999999, 3.4839169999999999, 3.4663330000000001,
3.4979710000000002, 3.5154299999999998, 3.5695960000000002,
3.5953759999999999, 3.4405770000000002, 3.5612689999999998,
3.5883020000000001, 3.2553610000000002, 3.5906060000000002,
3.6263239999999999, 3.5186410000000001, 3.5186410000000001]
X-len: 47 Y-len: 47
Traceback (most recent call last):
File "plot3d.py", line 77, in ?
spl= interpolate.splrep(xdata[i],zdata[i],s=0)
File "/usr/lib64/python2.4/site-packages/scipy/interpolate/fitpack.py", line
377, in splrep
raise _iermess[ier][1],_iermess[ier][0]
ValueError: Error on input data
I use scipy 0.5.1
Cheers
Martin
More information about the SciPy-User
mailing list