MODIS (version 1.1.7)

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,
  timeInfo = extractDate(x, asDate = TRUE)$inputLayerDates,
  interval = c("month", "year", "fortnight"),
  fun = max,
  na.rm = TRUE,
  cores = 1L,
  filename = "",
  ...
)

Arguments

x

Raster* or character. MODIS composite dataset with an associated "composite_day_of_the_year" SDS, e.g. all vegetation indices products (MOD13).

y

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

timeInfo

Date vector corresponding to all input layers. If not further specified, this is tried to be created through invoking extractDate upon 'x', assuming standard MODIS file names.

interval

character. Time period for aggregation, see aggInterval.

fun, na.rm

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, calc, writeRaster.

Examples

Run this code
# NOT RUN {
library(mapview)
frc <- as(subset(franconia, district == "Mittelfranken"), "Spatial")
tfs <- runGdal("MOD13A1", begin = "2015001", end = "2016366", extent = frc,
            job = "temporalComposite", SDSstring = "100000000010")

ndvi <- sapply(tfs[[1]], "[[", 1)
cdoy <- sapply(tfs[[1]], "[[", 2)

mmvc <- temporalComposite(ndvi, cdoy)
plot(mmvc[[1:4]])
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab