GIS-LAB

Geographic information systems and Remote sensing

Import MODIS data using MODIS-Import-tool

How to import MODIS data and software that can effectively facilitate this process.

Обсудить в форуме Комментариев — 0

Goal: Batch convert MODIS 2G, 3, 4 levels data in necessary projection and TIF format with simultaneous mosaicing if needed.

MODIS Reproject Tool (MRT) is the software used for effective reprojection and import of MODIS data. Using MRT can become tedious if trying to use it for large number of files. At the same time, using special commands files it is possible to make MRT run for all of them at once without any human interaction. MODIS-Import-tool can help save time and efforts on creating such files.

Basicaly, MODIS-Import-tool is the batch file generator for MRT. MODIS-Import-tool is quite easy to use. If you have dozens of MODIS files in the raw HDF format and MRT, you can use MODIS-Import-tool to generate special file which will include all necessary operations to mosaic, reproject HDF data to TIF formt. Creating such file takes several minutes, after making it, MRT will run and do all steps to generate data you need.

The result of the tool work is batch file !process-modis.bat or !process-modis-mosaics.bat created in working directory, name of the file depends on if you switch mosaicing on or not.

Particular attention during work should be paid to the location of source data. Depending on if need mosaicing or not, there are two options for file locations:

  1. Mosaic and reproject. All the files should be sorted into folders, so that all data for one day should be in the same folder. For example:
    c:\work
    	\A2000057
    	\A2000089
    	\A2000105 и т.д.

    Besides MODIS HDFs and XMLs there shouldn't be any other data in the folders.

    In each folder you can have one or several MODIS tiles for particular date. If you have several tiles in each folder and switch on Mosaic then Reproject flag, then MODIS-Import-Tool will ensure mosaicing tiles from each folder together before reprojecting. Working directory in this case is common folder for all folders, for example: c:\work\. The tool will go through all the folders in the working one, fild all images and mosaic, reproject them using other parameters that you'll set up. Names of the folders usually reflect date when image was taken.

    For automatic sorting it is convinient to use separate script Sort-MODIS. To run it, you will need Perl interpretator installed in the system. It is not necessary, though convinient to use this script for sorting.

    Script arguments are inputdir where source HDFs are and outputdir, where output groups will be created and source HDFs will be moved.

    sortmodis.pl inputdir outputdir

    You can also sort HDFs by hand.
  2. Reproject data only - if you have only one MODIS tile per time period they all can reside in one place, not in folders.

Other options:

Path to MRT - Path to the folder in which MODIS Reprojection Tool (MRT) is installed and where files resample.exe and mosaic.exe are. For example: C:\Gis\MRT\bin\

HDF files folder - Folder where MODIS HDFs are located.

Geographic/Albers/SIN - supported projections, Albers projection is supported with the following parameters: central meridian 45, first standard parallerl 52, second standard parallel 64. SIN - sinusoidal projection, sphere based, this projection is used by MODIS products on default. If you choose this projection, data is imported as it is.

Set AOI - define area of interest, if values are set, only portion of the input data is processed and output. Use of MRT 4.0 is recommended for correct interpretation of this parameter.

Import/no import bands - all MODIS products have several bands, each of then representing different thing. It is supposed, that you know which of these bands you need. In order not to import certain bands set corresponding 1 to 0. Total number of bands (number of 0s and 1s) should remain the same. Some of MODIS products have preset number of bands, all switched on (1) by default, if your MODIS product is not in the list, explore the documentation for it and put necessary number of total bands. For example: 1 1 0 0 0 0 0 0 - means import bands 1 and 2 of MODIS HDF which has 8 bands (number of zeroes and ones).

Overwrite existing files - allows not to redo already converted files, if you decided, for example to add another bands for import. Take into consideration, that if MRT was aborted the file which it has been creating at that moment will remain on disk, broken. MODIS-Import-tool will treat it as "existing" and will not overwrite it.

Mosaic then Reproject - first mosaic, then reproject and export data to TIF. All files in each folder will be mosaiced together first before reprojection. You should use this option if you have several tiles per each time period.

MOD Type - MODIS data product, if you couldn't find your product in the list, pick up a close one or put number of imported and non-imported bands carefully by hand.

Some import features:

  1. If number of bands in the source data is changing, selected bands will be keep importing, until number of set up ones will be reached. If you set more bands that there are in the source MODIS HDF, all of bands will be imported and process continues on next file.
    For example: MOD14A1 product (active fires) usually has 16 bands, 8 of which - daily thermal anomaly masksk and 8 quality assessment (QA) bands. However, sometimes some of day bands are missing and total number of bands is less then 16. In case of import of such file if the import string looks like this: 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0, i.e. import first 8 bands, and 7th and 8th bands are not in place, the import will be shift to the next 2 bands and 2 QA bands will be imported for day 1 and 2.
  2. Different data products, for example MOD14A1 and MOD13Q1, shouldn't be mixed together in the same folders.

The tool is under development, while is already being used quite intensively. Comments and bug reports are welcome.

If you're running this software for the first time, you'll need to download and install software libraries for VB .

Download MODIS-Import-tool

Обсудить в форуме Комментариев — 0

Последнее обновление: September 09 2021

Дата создания: 06.09.2006
Автор(ы): Максим Дубинин