GRASS logo

NAME

r.in.modis - Downloads and imports any MODIS product available on the Microsoft Planetary Computer STAC catalogue (surface reflectance, vegetation indices, land surface temperature, snow cover, burned area, and more) -- no account, API key, or signed request needed. Companion to r.in.sentinel and r.in.dem.

KEYWORDS

Import, imagery, satellite, MODIS, reflectance, vegetation index, land surface temperature, download, STAC, Planetary Computer, cloud, flood

SYNOPSIS

r.in.modis
r.in.modis --help
r.in.modis [-clj] [collection=string] [bands=string[,string,...]] start=string end=string [resolution=integer] output=basename [stac=string] [--overwrite] [--help] [--verbose] [--quiet] [--ui]

Flags:

-c
Apply cloud masking using the sur_refl_state_500m QA band's cloud-state bits (MOD09A1/MOD09Q1 only; mask out 'cloudy' and 'mixed', requires sur_refl_state_500m among the downloaded bands). Other MODIS products' own QA bands (e.g. VI_Quality, QC_Day, pixel_reliability) have different bit layouts -- download them as regular bands with -c omitted and interpret them yourself.
-l
List available dates/scenes and exit without downloading
-j
Write per-band metadata JSON to $MAPSET/cell_misc//description.json
--overwrite
Allow output files to overwrite existing files
--help
Print usage summary
--verbose
Verbose module output
--quiet
Quiet module output
--ui
Force launching GUI dialog

Parameters:

collection=string
Any MODIS STAC collection ID on Planetary Computer, e.g. modis-09A1-061 (surface reflectance 8-day 500m, default), modis-09Q1-061 (surface reflectance 8-day 250m), modis-13A1-061/modis-13Q1-061 (vegetation indices 16-day), modis-11A1-061/modis-11A2-061 (land surface temperature daily/8-day), modis-10A1-061/modis-10A2-061 (snow cover daily/8-day), modis-14A1-061/modis-14A2-061 (thermal anomalies/fire), modis-64A1-061 (burned area monthly), modis-15A2H-061/modis-15A3H-061 (LAI/FPAR), modis-16A3GF-061 (net evapotranspiration), modis-17A2H-061/modis-17A2HGF-061/modis-17A3HGF-061 (gross/net primary productivity), modis-21A2-061 (LST/emissivity), modis-43A4-061 (NBAR daily). Run with -l to list scenes for any collection before downloading.
Default: modis-09A1-061
bands=string[,string,...]
STAC asset names to download for the chosen collection. The default is specific to modis-09A1-061 (red/NIR/blue/green/SWIR1/SWIR2 + the state_500m QA/cloud band, matching flood_extent_fusion/modis_flood_index.py's EVI/LSWI/DVEL inputs) -- override this for any other collection (see that collection's Planetary Computer page for its asset names, or run with -l first).
Default: sur_refl_b01,sur_refl_b02,sur_refl_b03,sur_refl_b04,sur_refl_b06,sur_refl_b07,sur_refl_state_500m
start=string [required]
Start date (YYYY-MM-DD)
end=string [required]
End date (YYYY-MM-DD)
resolution=integer
Spatial resolution in meters (500 for -09A1, 250 for -09Q1)
Default: 500
output=basename [required]
Basename prefix for output raster maps (one per band per date: <output>_<YYYYMMDD>_<band>)
stac=string
STAC endpoint URL
Default: https://planetarycomputer.microsoft.com/api/stac/v1

Table of contents

DESCRIPTION

r.in.modis downloads and imports MODIS surface reflectance (MOD09A1, 8-day composite, 500m -- the exact product used by the Jamuna parametric flood insurance improvement project's EVI/LSWI/DVEL flood classifier) from the Microsoft Planetary Computer STAC catalogue, which needs no account, API key, or signed request. It is the MODIS sibling of r.in.sentinel (Sentinel-1/2) and r.in.dem (Copernicus DEM), sharing the same cubo-based Planetary Computer download path and authentication-free design.

The module determines the current GRASS region's center lat/lon and approximate edge size, requests a MODIS data cube for the given date range and bands via cubo.create(), optionally cloud-masks using the sur_refl_state_500m QA band's cloud-state bits (-c), optionally applies MOD09A1's reflectance scale factor (-r, raw digital numbers × 0.0001), and imports one raster map per band per date via r.import.

NOTES

Default bands cover red (sur_refl_b01), NIR (sur_refl_b02), blue (sur_refl_b03), green (sur_refl_b04), and two SWIR bands (sur_refl_b06, sur_refl_b07), plus the QA/cloud band sur_refl_state_500m -- matching exactly the inputs the EVI/LSWI/DVEL hierarchical flood classifier needs (NIR, RED, BLUE for EVI; NIR, SWIR for LSWI).

Use collection=modis-09Q1-061 for the 250m, red/NIR-only product instead of the default 500m 7-band product.

EXAMPLE

g.region n=26.3 s=24.1 w=89.2 e=90.1 res=500
r.in.modis output=modis_jamuna start=2026-01-01 end=2026-02-15 -r -c

REQUIREMENTS

SEE ALSO

r.in.dem, r.import, r.in.sentinel

AUTHORS

Yann Chemin

SOURCE CODE

Available at: r.in.modis source code (history)

Accessed: Sunday Sep 13 08:29:09 2026


Main index | Raster index | Topics index | Keywords index | Graphical index | Full index

© 2003-2026 GRASS Development Team, GRASS 8.5.1dev Reference Manual