genCompositions: Create image compositions from a time series of satellite...

Description Usage Arguments Details Value Examples

View source: R/genCompositions.R

Description

genCompositions combines a series of satellite images to create compositions.

Usage

1
genCompositions(rstack, by, fun, n, by.days = FALSE, verbose = FALSE, ...)

Arguments

rstack

a RasterStack, where layer names contain the capturing date of an image in "YYYYJJJ" format.

by

character argument. Accepts "month" or "year" for creating monthly or yearly composites. Only required if n is provided.

fun

the function used to create the composite, such as max, min, mean, ...

n

number of images combined in the aggregation. Only required if by is not provided.

by.days

logical argument. If FALSE, n indicates the number of consucutive images being aggregated. If TRUE, the function aggregates the imagery within every n days. The aggregation requires at least one image avaiable.

verbose

logical argument. If TRUE, the function prints the running steps and warnings.

...

arguments for nested functions:

  • AppRoot the path where the images will be saved in the GTiff format.

Details

The layer of the composite image takes its name from the first image used in the composition.

genCompositions reduces the number of images but improves the total quality of the time-series by removing cloulds and outliers. One widespread compositing technique is the maximum value composition (MVC). This technique allocates in each pixel of the composite the maximum value (fun = max) that the pixel reaches during a time period (n, by.days = TRUE).

Value

a RasterStack with the time series of the composite images.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
# loading NDVI images of Navarre
data("ex.ndvi.navarre")
# Ploting the images: clouds are found
genPlotGIS(ex.ndvi.navarre)
# the first composite image is made with images 1, 2 and 3, 
# and the second composite image is made with images 4, 5 and 6
composite.NDVI.a <- genCompositions(rstack = ex.ndvi.navarre,
                                    n = 3,
                                    fun = max)
genPlotGIS(composite.NDVI.a)
# when by.days=TRUE, the first composite image is made with images 1, 2 and 3, 
# the second with image 4, and the third with images 5 and 6.
composite.NDVI.3a <- genCompositions(rstack = ex.ndvi.navarre,
                                     n = 3,
                                     by.days = TRUE,
                                     fun = max)
# Check that the clouds were removed
genPlotGIS(composite.NDVI.3a)

RGISTools documentation built on July 2, 2020, 3:58 a.m.