Note: This article is the author of the study of scientific research work needs to be summarized, the original published in the QQ personal space, because after several years of work there are students need to do similar work, open to this place, easy for more people to retrieve.
Sinsonglew Source: Http://www.cnblogs.com/sinsonglew Welcome reprint, Please also keep this statement. Thanks:)
1 Installation of MRT tools
Check if java.exeis installed on your PC (search Java.exe can, of course, do not check, reinstall a copy), under WINDOWS platform,java. The installation path of the virtual machine and the installation path of MRT should not contain spaces.
During installation under the WINDOWS platform, enter the pathname note that the slash "\" should be changed to "/", such as C:\Modis must be entered as c:/ Modis.
Before you install MRT , you need to install the JAVA virtual machine, because you will be prompted to enter the java.exe path during the installation of MRT .
2 MRT tool use and batch processing operation
2.1 Interface Operation
After installation, open the MRT installation path folder, open the Bin folder, find modistool.bat, create a shortcut to the desktop file, double-click the shortcut to enter the MRT GUI interface (see fig.1).
In Fig.1 , for MODIS myd13q1 data, select output EVI ,NDVI Two data, specify output path output file format is GEOTIFF, The sampling method is the nearest neighbor, the projection type is UTM, the output cell size is 250m, and then you can click Run directly.
fig.1 MRT GUI interface
2.2 Batch processing projection
See Fig.1 in the Red Oval delineation section, set a HDF file Projection transformation parameters, click "save Parameterfiles ..." To save their own set of parameters, assuming that the HEAD.PRM .
Create a new Notepad file, paste the following into it, and you need to change several places . After the change is complete, save the Notepad file as a ". bat" file, assuming "modis.bat".
REMSet the Mrtdatadir environmental var to the MRT data directory. REM **********************************************************REMREMReplace "C:\Modis\data" to your own Mrtdatadir setuped "REMrefer to "Modistool.bat", right key and choose "Edit" and "ll get" Mrtdatadir "REM *********************************************************** SetMrtdatadir=C:\Modis\dataREM **********************************************************REMREMChange HEAD.PRM to your own. prm file, then it ' s ok!REMIf somethings wrong, change resample to full path. i.e.REM"for%%i in (*.HDF) do resample -P head.prm-i%%i-o%%iout.tif"REMTo "for%%i in (*.HDF) do C:\Modis\bin\resample.exe -P head.prm-i%%i-o%%iout.tif"REMREM *********************************************************** for%%i in (*.HDF) DoResample-pHEAD.PRM-I.%%i-o%%iout.tif
The above content can be pasted into your own Notepad file, note that the Red font part of the need to change the section. The Blue font section is for attention content. REM is the meaning of the note, and the contents of the subsequent note can be deleted.
Create a new folder, assuming that it is named DATA, place head.prm,modis.bat, all modis HDF data in this folder, double-click modis.bat , you can see the batch process of the command window, such as an exception, see the Blue content in the section.
2.3 Batch processing splicing
Note: This operation data and BAT file must be placed in a folder (the folder name in English, MRT on the Chinese path data will not open) under.
Operation Steps:
1: Create a new Data folder and copy the HDF data to the database folder;
2: In the Data folder, create a new result folder (storage splicing data);
3: Paste the following code content into a TXT file ( below the code green font content for the code comment content, please delete ), change the TXT file extension to BAT, if you name the bat file named Mosaic.bat;
4: Click on the Mosaic.bat, you can do splicing operation, if there is a problem, see the "2.2 batch projection " in the attention of the content.
PS: The following code does not consider the intermediate days of interruption, such as the MODIS time resolution of 16 days of data, in a continuous arithmetic progression in the middle of the data is missing, there is a difference of 32 days, may be error, please note.
SetMrtdatadir=c:\modis\DataSet/A day=2009257REM* * * Start date * * *Set/A deadline=2009273REM* * * End Date * * *: Startif%day% Leq%deadline% (GotoORDER)Else Exit: ORDERREM* * Put the day's picture data file name in a TXT file * *dir*%day%.*.hdf/a/b/s > Mosaicinput.TXTREM* * Stitching the first type of HDF12 data * *C:/modis/bin/mrtmosaic.exe-i Mosaicinput. Txt-s "1 0 0 0 0 0 0 0 0 0 0 0"-o mosaic_tmp_%day%.HDFREM* * Copy the stitched data into the built result folder and delete the data of the day * *CopyMOSAIC_TMP_%DAY%.HDF Result &delmosaic_tmp_%day%.HDFdel*%day%.*.HDFSet/a day=%day% + 16REM* * * stitching the next time phase data * * *Goto Start
MODIS MRT installation, Image batch processing projection and splicing