temporalComposite: Calculate MODIS Composite Images

Description Usage Arguments Value Author(s) See Also Examples

View source: R/temporalComposite.R

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
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.

Author(s)

Florian Detsch

See Also

aggInterval, calc, writeRaster.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## 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)

MODIS documentation built on Nov. 12, 2020, 5:06 p.m.