The input file is given as a list of full paths to the MODIS HDF files, one per line. The input file(s) have to be inside the folder where the HDF files are stored.
If mrtpath is not used, pyModis will use GDAL to convert HDF files to TIF (which is faster).
The mrtpath option is the path to the main folder of the MODIS Reprojection Tools (MRT) binaries, i.e. the folder which contains the bin/ and the data/ folder, since these two folders are essential for obtaining a successful result.
Warning:
NOTE: In order to work with the temporal framework of GRASS GIS the flag w must be set during the import with i.modis.import.
SDS layer | Spectral | Spectral QA |
Aerosol Optical Depth at 047 micron | 0 | 0 |
Aerosol Optical Depth at 055 micron | 1 | 1 |
AOD Uncertainty at 047 micron | 0 | 0 |
Fine-Mode Fraction for Ocean | 0 | 0 |
Column Water Vapor in cm liquid water | 0 | 0 |
AOD QA | 0 | 1 |
AOD Model (Regional background model used) | 0 | 0 |
Injection Height (Smoke injection height over local surface height) Grid 5km | 0 | 0 |
Cosine of Solar Zenith Angle | 0 | 0 |
Cosine of View Zenith Angle | 0 | 0 |
Relative Azimuth Angle | 0 | 0 |
Scattering Angle | 0 | 0 |
Glint Angle | 0 | 0 |
i.modis.import input=/path/to/file
Import of files from a list with all the subsets using MRT (if mrtpath is not provided, GDAL is used):
i.modis.import files=/path/to/listfile mrtpath=/path/to/mrt
Import of files from a list as mosaics per date without QA layers using MRT:
i.modis.import -mq files=/path/to/listfile mrtpath=/path/to/mrt
Import of a single file with user-specific subset of layers using GDAL:
i.modis.import input=/path/to/file spectral="( 1 0 1 0 )"
Import of files from a list with user-specific subset of layers and without QA layer using MRT:
i.modis.import -q files=/path/to/listfile mrtpath=/path/to/mrt spectral="( 1 )"
Import of a single subset of layers (i.e.: spectral="( 1 )") from each file of a list and write an outfile to be used with t.register to assign timestamps to maps in the temporal database and register them in a spacetime dataset. This option uses GDAL:
i.modis.import -wq files=/path/to/listfile spectral="( 1 )" outfile=/path/to/list_for_tregister.csv
# download the two years worth of data i.modis.download settings=~/.rmodis product=ndvi_terra_sixteen_5600 \ startday=2015-01-01 endday=2016-12-31 folder=$USER/data/ndvi_MOD13C1.061 # import band 1 = NDVI i.modis.import files=$USER/data/ndvi_MOD13C1.061/listfileMOD13C1.061.txt spectral="( 1 )" \ method=bilinear outfile=$USER/data/ndvi_MOD13C1.061/list_for_tregister.csv -w # create empty temporal DB t.create type=strds temporaltype=absolute output=ndvi_16_5600m title="Global NDVI 16 days MOD13C1" \ description="MOD13C1 Global NDVI 16 days" semantictype=mean # register maps within spacetime datasets (the file name is provided by # i.modis.import using -w flag and outfile option) t.register input=ndvi_16_5600m file=$USER/data/ndvi_MOD13C1.061/list_for_tregister.csv # verify and visualize timeline t.rast.list ndvi_16_5600m g.gui.timeline ndvi_16_5600m
i.modis.download settings=$HOME/SETTING product=lst_terra_eight_1000 \ tiles=h18v04,h18v05 startday=2016-12-23 endday=2016-12-31
i.modis.import -m files=$HOME/listfileMOD11A1.061.txt \ spectral="( 1 1 0 0 0 0 0 0 0 0 0 0 )"
for map in `g.list type=raster pattern="*_QC_Day"` ; do i.modis.qc input=${map} output=${map}_mandatory_qa \ productname=mod11A1 qcname=mandatory_qa_11A1 done for m in `g.list rast pat=*2016*LST_Day_1km` ; do # get name of product and date from filenames i=`echo $m | cut -c 1-16` # apply qa flags r.mapcalc --o expression="${m} = if(${i}_mosaic_QC_Day_mandatory_qa < 2, ${m}, null())" done
t.create type=strds temporaltype=absolute output=LST_Day_daily \ title="Daily LST Day 1km" \ description="Daily LST Day 1km MOD11A1.061, December 2016" t.register -i input=LST_Day_daily \ maps=`g.list type=raster pattern="*2016*LST_Day_1km" separator=comma` \ start="2016-12-23" increment="1 day"
t.rast.list LST_Day_daily g.gui.timeline LST_Day_daily
It is also possible to create a time series using the list of maps with start and end time written by i.modis.import with the w flag and outfile option.
# Import mosaics of LST Day for all dates using the list of downloaded files from # i.modis.download (see above) and get a list of the imported files along with # dates to use with t.register in the temporal framework i.modis.import -mw files=$HOME/listfileMOD11A1.061.txt \ spectral="( 1 0 0 0 0 0 0 0 0 0 0 0 )" outfile=$HOME/list_for_tregister.csv # Create time series and register maps t.create type=strds temporaltype=absolute output=LST_Day_daily \ title="Daily LST Day 1km" \ description="Daily LST Day 1km MOD11A1.061, December 2016" t.register input=LST_Day_daily file=$HOME/list_for_tregister.csv
GRASS GIS Wiki: temporal data processing
Map of MODIS Land products' Sinusoidal grid tiling system
Available at: i.modis.import source code (history)
Latest change: Monday Jan 30 19:52:26 2023 in commit: cac8d9d848299297977d1315b7e90cc3f7698730
Main index | Imagery index | Topics index | Keywords index | Graphical index | Full index
© 2003-2023 GRASS Development Team, GRASS GIS 8.2.2dev Reference Manual