一年中的12个月份的月最大合成(mvc)数据放在“F:\\Vegetation Change\\Data\\GIMMS Data\\1MVC\\",数据名称格式为mvc_198801,mvc_198802........mvc_198812。处理年份为1981-2006,代码为:
import arcpy
arcpy.CheckOutExtension("spatial")
str="F:\\Vegetation Change\\Data\\GIMMS Data\\1MVC\\"+"mvc_"
for i in range(1981,2007):a1 = +str(i)+"01"a2 = str+str(i)+"02"a3 = str+str(i)+"03"a4 = str+str(i)+"04"a5 = str+str(i)+"05"a6 = str+str(i)+"06"a7 = str+str(i)+"07"a8 = str+str(i)+"08"a9 = str+str(i)+"09"a10 = str+str(i)+"10"a11 = str+str(i)+"11"a12 = str+str(i)+"12"out = "F:\\Vegetation Change\\Data\\GIMMS Data\\2Max\\max_"+str(i)arcpy.gp.CellStatistics_sa((a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12), out, "MAXIMUM", "DATA")print(str(i) +" has done")
print("All done,please close!")