Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/image-processing/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python scipy插值中的导数()函数显示错误_Python_Scipy_Interpolation_Spatial Interpolation - Fatal编程技术网

Python scipy插值中的导数()函数显示错误

Python scipy插值中的导数()函数显示错误,python,scipy,interpolation,spatial-interpolation,Python,Scipy,Interpolation,Spatial Interpolation,我正在尝试在道路坐标之间进行插值,以获得道路的几何特征,如弯道的曲率半径等。我使用了scipy.interpolate模块中的单变量样条进行三次插值。 xtemp是经度列表,ytemp是相应的纬度列表 spl = UnivariateSpline(xtemp,ytemp,k=3) 当我使用附加到样条曲线的导数()方法时,它抛出以下错误 spl.derivatives(xtemp[10]) 它抛出以下错误,这是暗示点不可微还是其他什么 回溯(最近一次呼叫最后一次): 文件“jn.py”,第18

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

spl = UnivariateSpline(xtemp,ytemp,k=3)
当我使用附加到样条曲线的导数()方法时,它抛出以下错误

spl.derivatives(xtemp[10])
它抛出以下错误,这是暗示点不可微还是其他什么

回溯(最近一次呼叫最后一次): 文件“jn.py”,第182行,在 印刷品(特殊衍生产品(x[2])) 文件“D:\AMESim\v1410\sys\python\win32\lib\site packages\scipy\interpolate\fit pack2.py”,第274行,在衍生产品中 raise VALUERROR(“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]

再看一看,其中指出
x
中的值必须增加。数组
xtemp
中的值没有增加。插值本身不需要对xtemp排序,也不需要对ytemp进行相应的重新排序。但是,如果我对xtemp进行排序并尝试插值,数据会出现许多错误,如下图所示