-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'

python 2.6 scipy-0.7.1-win32-superpack-python2.6 numpy-1.6.1-win32-superpack-python2.6 ARCGIS 10

4

1 回答 1

0

您必须将 Raster 对象转换为 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]])
于 2013-05-07T19:22:49.257 回答