NPP(净初级生产)百分比变化的Python脚本

时间:2015-06-25 23:44:21

标签: python raster

你能否建议一个python脚本,用于百分比改变光栅从"开始一年"(Inras1)到"结束一年" (Inras2)植被净初级生产栅格?示例:与#34;开始年份"

相比,给定的栅格单元增加了25%

`

1 个答案:

答案 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")