scipy interpolate中的derivative()函数显示错误

时间:2017-02-01 13:16:36

标签: python scipy interpolation spatial-interpolation

我试图在道路的坐标之间进行插值,以获得道路的几何特征,例如弯道的曲率半径等。我使用了单变量线来进行scipy.interpolate模块的三次插值。 xtemp是经度列表,ytemp是相应的纬度列表。

spl = UnivariateSpline(xtemp,ytemp,k=3)

当我使用附加到样条线的衍生物()方法时,它会抛出以下错误

spl.derivatives(xtemp[10])

它会抛出以下错误,是否暗示该点不可区分或其他什么?

追踪(最近一次通话): 文件“jn.py”,第182行,in     打印(spl.derivatives(X [2])) 文件“D:\ AMESim \ v1410 \ sys \ python \ win32 \ lib \ site-packages \ scipy \ interpolate \ fit pack2.py“,第274行,衍生品     引发ValueError(“spalde返回的错误代码:%s”%ier) ValueError:spalde返回的错误代码:10

xtemp = [8703920.78692712, 8703906.2622004, 8703883.84424534, 8703857.51706609, 8703839.00700972, 8703839.00700972, 8703762.221569888, 8703722.58053881, 8703717.537140463, 8703693.73244574, 8703680.745786697, 8703676.055463126, 8703657.294169707, 8703624.083750296, 8703608.197236568, 8703598.085357253, 8703589.41086534, 8703586.157930875, 8703572.061881518, 8703563.740463715, 8703551.813036853, 8703542.054233056, 8703533.026667913, 8703520.393095948, 8703514.61846597, 8703511.3655319, 8703496.941503718, 8703467.36221086, 8703443.910623178, 8703441.742001873, 8703412.515789656, 8703389.064207405, 8703349.701053293, 8703331.645944124, 8703290.845417619, 8703270.268620526, 8703220.087484688, 8703214.665938457, 8703173.840350397, 8703150.716785626, 8703117.128297202, 8703094.735974662, 8702986.708362725, 8702968.30021866, 8702968.30021866, 8702968.653287353, 8702988.072504919, 8702990.820428345, 8702993.46747147, 8702994.501179518, 8703000.047897372, 8703003.098120295, 8703003.451109644, 8703005.139966955, 8703008.99741367, 8703010.762318444, 8703022.865115577, 8703024.30241384, 8703035.018622331, 8703067.847396487, 8703069.637638697, 8703115.703180157, 8703127.12478991, 8703150.69920557, 8703150.69920557, 8703156.04421489, 8703121.294462884, 8703078.928779112, 8703061.90679049, 8703049.222124506, 8703042.337621557, 8703026.374345265, 8703004.61085956, 8702995.179149663, 8702990.463291803, 8702977.778566932, 8702954.224858753, 8702919.827772195, 8702877.1088633, 8702829.34678379, 8702788.822134437, 8702747.21312519, 8702678.117107326, 8702652.067331942, 8702608.289574081, 8702583.324111609, 8702529.434410162, 8702507.369068393, 8702458.169548828, 8702367.007934146, 8702325.398703687, 8702278.341975044, 8702155.734331386, 8702076.250575945, 8702042.28323943, 8702015.906274809, 8701999.994036576, 8701999.994036576, 8702005.99226121, 8702010.604932578]

ytemp = [1456384.12417524, 1456423.08671529, 1456469.84176335, 1456525.50253485, 1456563.35185947, 1456563.35185947, 1456590.0690297901, 1456605.65404581, 1456607.88047667, 1456614.55976925, 1456617.89941554, 1456619.01263097, 1456623.46549269, 1456629.03156984, 1456631.2580007, 1456632.3712161302, 1456632.3712161302, 1456632.3712161302, 1456632.3712161302, 1456631.2580007, 1456631.2580007, 1456631.2580007, 1456632.3712161302, 1456634.5976469899, 1456635.71086242, 1456635.71086242, 1456640.1637241403, 1456647.95623215, 1456653.5223093, 1456653.5223093, 1456660.2016018801, 1456665.76767903, 1456670.22054075, 1456672.44697161, 1456678.0130487601, 1456681.35269505, 1456689.14520306, 1456689.14520306, 1456691.3716339201, 1456692.48484935, 1456695.8244956401, 1456698.0509265, 1456703.61700365, 1456706.9566499402, 1456706.9566499402, 1456705.84343451, 1456548.88005888, 1456482.08713308, 1456449.8038856103, 1456443.12459303, 1456411.95456099, 1456385.23739067, 1456384.12417524, 1456368.5391592202, 1456352.9541432, 1456347.3880660501, 1456322.89732659, 1456321.78411116, 1456305.08587971, 1456249.42510821, 1456247.19867735, 1456173.7264589702, 1456154.80179666, 1456118.0656874701, 1456118.0656874701, 1456108.0467486, 1456101.36745602, 1456091.34851715, 1456086.89565543, 1456082.44279371, 1456080.21636285, 1456072.42385484, 1456062.4049159698, 1456057.95205425, 1456055.7256233902, 1456051.27276167, 1456043.4802536601, 1456035.68774565, 1456026.7820222103, 1456020.10272963, 1456014.53665248, 1456008.97057533, 1456001.17806732, 1455997.8384210302, 1455992.27234388, 1455988.93269759, 1455984.4798358702, 1455982.2534050099, 1455976.68732786, 1455966.66838899, 1455961.10231184, 1455952.1965884, 1455942.17764953, 1455946.63051125, 1455947.74372668, 1455948.85694211, 1455947.74372668, 1455947.74372668, 1455928.8190643701, 1455917.6869100702]

the image represents the first 2km or so of the road i plotted after interpolation

0 个答案:

没有答案
相关问题