temporalComposite.Rd 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. % Generated by roxygen2: do not edit by hand
  2. % Please edit documentation in R/temporalComposite.R
  3. \name{temporalComposite}
  4. \alias{temporalComposite}
  5. \title{Calculate MODIS Composite Images}
  6. \usage{
  7. temporalComposite(x, y, timeInfo = extractDate(x, asDate =
  8. TRUE)$inputLayerDates, interval = c("month", "year", "fortnight"),
  9. fun = max, na.rm = TRUE, cores = 1L, filename = "", ...)
  10. }
  11. \arguments{
  12. \item{x}{\code{Raster*} or \code{character}. MODIS composite dataset with an
  13. associated "composite_day_of_the_year" SDS, e.g. all vegetation indices
  14. products (MOD13).}
  15. \item{y}{\code{Raster*} or \code{character}. MODIS
  16. "composite_day_of_the_year" SDS associated with 'x'.}
  17. \item{timeInfo}{\code{Date} vector corresponding to all input layers. If not
  18. further specified, this is tried to be created through invoking
  19. \code{\link{extractDate}} upon 'x', assuming standard MODIS file names.}
  20. \item{interval}{\code{character}. Time period for aggregation, see
  21. \code{\link{aggInterval}}.}
  22. \item{fun, na.rm}{\code{function}. See \code{\link{overlay}}.}
  23. \item{cores}{\code{integer}. Number of cores for parallel processing.}
  24. \item{filename}{\code{character}. Optional output filename.}
  25. \item{...}{Additional arguments passed to \code{\link{writeRaster}}.}
  26. }
  27. \value{
  28. A \code{Raster*} object.
  29. }
  30. \description{
  31. Based on a user-defined function, e.g. \code{max} for maximum value
  32. composites (MVC), aggregate native 16-day MODIS datasets to custom temporal
  33. composites.
  34. }
  35. \examples{
  36. \dontrun{
  37. library(mapview)
  38. frc <- as(subset(franconia, district == "Mittelfranken"), "Spatial")
  39. tfs <- runGdal("MOD13A1", begin = "2015001", end = "2016366", extent = frc,
  40. job = "temporalComposite", SDSstring = "100000000010")
  41. ndvi <- sapply(tfs[[1]], "[[", 1)
  42. cdoy <- sapply(tfs[[1]], "[[", 2)
  43. mmvc <- temporalComposite(ndvi, cdoy)
  44. plot(mmvc[[1:4]])
  45. }
  46. }
  47. \seealso{
  48. \code{\link{aggInterval}}, \code{\link{calc}}, \code{\link{writeRaster}}.
  49. }
  50. \author{
  51. Florian Detsch
  52. }