Learn R Programming

rsMove (version 0.2.4)

rsComposite: rsComposite

Description

Phenological and date driven Pixel Based Compositing (PBC) of remote sensing data supported by GPS tracking date information.

Usage

rsComposite(img, img.dates, obs.dates, comp.method = "closest",
  temporal.buffer = NULL)

Arguments

img

Object of class RasterStack or RasterBrick.

img.dates

Object of class Date with img observation dates.

obs.dates

Object of class Date with reference dates.

comp.method

One of "closest" or "phenological".

temporal.buffer

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

Value

A list.

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 determines the Median Absolute Deviation (MAD) of obs.dates which determines the temporal buffer that is used to search for usable images. 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: #'

  • closest - Uses layer with the closest possible date in relation to the reference date.

  • phenological - Uses the layer with the Day of the Year (DoY) in relation to the reference date.

The final output of rsComposite is a list consisting of: #'
  • composite - Final image composite

  • dates - Temporal composition of the composite reporting on the julian day

  • pixel.count - pixel count of unique values in dates. Additionally, it reports on NA values.

  • target.date - Reference date used during compositing.

  • temporal.buffer - Temporal buffer used during compositing.

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.

See Also

imgInt dataQuery

Examples

Run this code
# 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)
 img.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, img.dates, obs.dates, comp.method="closest", temporal.buffer=90)

# }

Run the code above in your browser using DataLab