ArcGIS Python enables the largest synthesis of Modis ndvi batch Month

Source: Internet
Author: User

The maximum synthesis (MVC) can be done in band math in Envi, which is b1>b2, but cannot be batched. This article is now in bulk in ArcGIS using Python code, such as the following:

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.

python code such as the following:   

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 "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 file name string.

ArcGIS Python enables the largest synthesis of Modis ndvi batch Month

Related Article

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.