temporalComposite: Calculate MODIS Composite Images

View source: R/temporalComposite.R

temporalCompositeR Documentation

Calculate MODIS Composite Images

Description

Based on a user-defined function, e.g. max() for maximum value composites (MVC), aggregate native 16-day MODIS data sets 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 data set 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 raster::overlay().

cores

integer. Number of cores for parallel processing.

filename

character. Optional output file name.

...

Additional arguments passed to raster::writeRaster().

Value

A Raster* object.

Author(s)

Florian Detsch

See Also

aggInterval(), raster::calc(), raster::writeRaster().

Examples

## 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]])

## End(Not run)


MatMatt/MODIS documentation built on Feb. 1, 2023, 12:39 a.m.