rsComposite: rsComposite

Description Usage Arguments Details Value See Also Examples

View source: R/rsComposite.R

Description

Phenological and date driven Pixel Based Compositing (PBC).

Usage

1
2
3
4
5
6
7
rsComposite(
  x,
  x.dates,
  obs.dates,
  comp.method = "closest",
  temporal.buffer = NULL
)

Arguments

x

Object of class RasterStack or RasterBrick.

x.dates

Object of class Date with x observation dates.

obs.dates

Object of class Date with reference dates.

comp.method

One of "closest" or "phenological". The default is "closest".

temporal.buffer

Search buffer (expressed in days). The default is NULL.

Details

The function uses a multi-layer raster object to build a composite for a reference date which corresponds to the median of obs.dates. Moreover,the function estimates the Median Absolute Deviation (MAD) of obs.dates which determines the temporal buffer that is used to search for usable data. As an alternative, temporal.buffer can be specified manually and will be required if obs.dates consists of a single value. The user can also specify how the compositing should be done. comp.method can be set to: #'

The final output of rsComposite is a list consisting of: #'

If pheno2 is used, for each pixel, the function will estimate a weighted mean of the clear pixels within the temporal buffer. The weights represent the inverse time difference between the target and the available dates giver higher weights to small differences.

Value

A list.

See Also

imgInt dataQuery

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
## Not run: 

 require(raster)

 # read raster data
 file <- list.files(system.file('extdata', '', package="rsMove"), 'ndvi.tif', full.names=TRUE)
 r.stk <- stack(file)
 r.stk <- stack(r.stk, r.stk, r.stk) # dummy files for the example

 # raster dates
 file.name <- names(r.stk)
 x.dates <- as.Date(paste0(substr(file.name, 2, 5), '-',
 substr(file.name, 7, 8), '-', substr(file.name, 10, 11)))

 # target date
 obs.dates = as.Date("2013-06-01")

 # build composite
 r.comp <- rsComposite(r.stk, x.dates, obs.dates, comp.method="closest", temporal.buffer=90)


## End(Not run)

RRemelgado/rsMove documentation built on June 7, 2020, 5:12 p.m.