2013-05-07 49 views
-1
>>> dd=special.kv(0,Raster("adiff_C1.tif")) 
Runtime error <type 'exceptions.TypeError'>: ufunc 'kv' not supported for the input  types, and the inputs could not be safely coerced to any supported types according to the casting rule 'safe' 

蟒蛇2.6 SciPy的-0.7.1-Win32的superpack-python2.6的 numpy的-1.6.1-Win32的superpack-python2.6的 ArcGIS 10的有什麼方法可以使用特殊功能與柵格?

+0

請制定一個很好的問題,有沒有可能的方法來了解發生了什麼。添加發生了什麼,以及你想要做什麼。這樣人們可以輕鬆地幫助你。 – aimbire 2013-05-07 19:18:13

回答

0

你必須convert your Raster object to a numpy array。然後scipy.special.kv將工作正常:

In [9]: x = numpy.array([[1,2,3],[4,5,6]]) 

In [10]: x 
Out[10]: 
array([[1, 2, 3], 
     [4, 5, 6]]) 

In [11]: special.kv(0, x) 
Out[11]: 
array([[ 0.42102444, 0.11389387, 0.0347395 ], 
     [ 0.01115968, 0.0036911 , 0.00124399]]) 
+0

感謝您的回答。很棒 – 2013-05-09 12:51:24

相關問題