我知道 NDVI 方程是
NDVI = (NIR — VIS)/(NIR + VIS)
我正在尝试使用python计算它。到目前为止我有这个:
inRaster = ('Landsat.tif')
out_NDVI_file = ('NDVI.tif')
red = arcpy.Describe(inRaster+'/Band_3')
NIR = arcpy.Describe(inRaster+'/Band_4')
num = arcpy.sa.Float(NIR-red)
denom = arcpy.sa.Foat(NIR+red)
NDVI = arcpy.sa.Divide(num, denom)
NDVI.Save(out_NDVI_file)
但我收到此错误消息,
Traceback (most recent call last):
File "F:\abc\def.py", line 32, in <module>
num = arcpy.sa.Float(NIR-red)
TypeError: unsupported operand type(s) for -: 'geoprocessing describe data object' and 'geoprocessing describe data object'
关于我做错了什么的任何想法?