Learn R Programming

MODIS (version 1.0.0)

temporalComposite: Calculate MODIS Composite Images

Description

Based on a user-defined function, e.g. max for maximum value composites (MVC), aggregate native 16-day MODIS datasets to custom temporal composites.

Usage

temporalComposite(x, y, interval = c("month", "fortnight"),
  fun = function(x) max(x, na.rm = TRUE), cores = 1L, filename = "", ...)

Arguments

x

Raster* or character. MODIS vegetation index.

y

Raster* or character. MODIS "composite_day_of_the_year" SDS associated with 'x'.

interval

character. Time period for aggregation, see aggInterval.

fun

function. See overlay.

cores

integer. Number of cores for parallel processing.

filename

character. Optional output filename.

...

Additional arguments passed to writeRaster.

Value

A Raster* object.

See Also

aggInterval, overlay, writeRaster.

Examples

Run this code

runGdal("MOD13Q1", collection = getCollection("MOD13Q1", forceCheck = TRUE),
        begin = "2015001", end = "2015365", extent = "Luxembourg",
        job = "temporalComposite", SDSstring = "100000000010")

ndvi <- list.files(paste0(getOption("MODIS_outDirPath"), "/temporalComposite"),
                   pattern = "NDVI.tif", full.names = TRUE)

cdoy <- list.files(paste0(getOption("MODIS_outDirPath"), "/temporalComposite"),
                   pattern = "day_of_the_year.tif", full.names = TRUE)

mmvc <- temporalComposite(ndvi, cdoy)
plot(mmvc[[1:4]])


Run the code above in your browser using DataLab