The largest synthesis of Modis NDVI for the month by ArcGIS Python

Source: Internet
Author: User

The maximum synthesis method (MVC) can be done in band math in Envi, B1>B2, but not batched; This article implements the Python code in bulk in ArcGIS, as follows:

The MODIS NDVI data used is the monthly data after splicing and projection in MRT, one months has two periods, the data format is. tif, the format of the file name is: 20040101.1_km_16_days_ndvi.tif,20040102.1_km_16_ Days_ndvi.tif represents the two-year data for January 2004. This treatment is for 2004-2013 years of data for 10 years.

The Python code is as follows:   

Import Arcpyimport timearcpy. Checkoutextension ("spatial") time1=time.strftime ('%y-%m-%d-%h:%m:%s ') sname1= "f:\\modis_16\\1moasic\\" Sname2= ". 1 _km_16_days_ndvi.tif "out =" f:\\modis_16\\2mvc\\ddwwq "for  I in range (2004,2014): for    J in Range (1,13):        if J>9:            year= str (i) +str (j) + "0"        else:            year= str (i) + "0" +str (j) + "0"        print sname1+year+ "1" +sname2        print sname1+year+ "2" +sname2        out= "f:\\modis_16\\2mvc\\" +year[0:6]        print out + "are being ..."        Arcpy.gp.CellStatistics_sa ((sname1+year+ "1" +sname2,sname1+year+ "2" +sname2), Out, "MAXIMUM", "DATA")        Print out + "have done ..." "        print"-------------------------------------------------------"print" <---- ------ALL is done!!! ----------> "Print" Start Time: "+time1print" End time   : "+time.strftime ('%y-%m-%d-%h:%m:%s ')
Insight: The core part of this process is the patchwork of file name strings.

ArcGIS Python maximizes the monthly synthesis of MODIS ndvi

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.