Skip to contents

Reads MODIS/061/MOD13A2 (Terra Vegetation Indices 16-Day L3 1km) from Google Earth Engine for the specified date. Returns a terra::rast() SpatRaster with QA-masked, scaled NDVI values (range: approximately -0.2 to 1.0).

Usage

read_modis_ndvi(
  date,
  region,
  backend = c("rest", "rgee"),
  cache = TRUE,
  max_tries = 3L,
  initial_delay = 1
)

Arguments

date

Character or Date. Acquisition date in "YYYY-MM-DD" format. The nearest available 16-day composite containing this date is returned.

region

An sf::sf, sf::st_sfc(), or terra::ext() object defining the spatial extent. Required.

backend

Character. "rest" (default) or "rgee".

cache

Logical. Use disk cache? Default TRUE.

max_tries

Integer. Retry attempts. Default 3L.

initial_delay

Numeric. Initial retry delay in seconds. Default 1.

Value

A terra::rast() SpatRaster. CRS: EPSG:4326. Values: NDVI (scaled, approximately -0.2 to 1.0). NA where QA indicates poor quality.

Data availability

2000-02-18 to present. 16-day composites. 1 km spatial resolution.

QA masking

Pixels with SummaryQA > 1 (snow/ice, cloudy) are masked to NA. Only good (0) and marginal (1) quality pixels are retained.

References

Didan, K. (2021). MODIS/Terra Vegetation Indices 16-Day L3 Global 1km SIN Grid V061. NASA EOSDIS Land Processes Distributed Active Archive Center. doi:10.5067/MODIS/MOD13A2.061

See also

Examples

if (FALSE) { # interactive()
ndvi <- read_modis_ndvi(date = "2024-06-15",
                        region = terra::ext(138, 140, -36, -34))
terra::plot(ndvi)
}