你能否建议一个python脚本,用于百分比改变光栅从"开始一年"(Inras1)到"结束一年" (Inras2)植被净初级生产栅格?示例:与#34;开始年份"
相比,给定的栅格单元增加了25%`
答案 0 :(得分:0)
# Name: Minus_Ex_02.py
# Description: Modification of ESRI's Subtracts the value of the second input raster from the Value of the first input raster on a cell-by-cell basis
# Requirements: Spatial Analyst Extension
# Author: ESRI
# Import system modules
import arcpy
from arcpy import env
from arcpy.sa import *
# Set environment settings
env.workspace = "C:/Users/Kaleab/Desktop/MOD17A3/Mosaic/Clip"
# Set local variables
inRaster1 = "2000clip.tif"
inRaster2 = "2010clip.tif"
# Check out the ArcGIS Spatial Analyst extension license
arcpy.CheckOutExtension("Spatial")
# Execute Minus
outMinus = Minus(inRaster1, inRaster2)
changeras = outMinus/inRaster1
# Save the output
changeras.save("C:/Users/Kaleab/Desktop/MOD17A3/Mosaic/Clip/Change.tif")