rsMove (version 0.2.1)

rsComposite: rsComposite

Description

Compositing of remote sensing data based on GPS tracking dates.

Usage

rsComposite(img, rd, ot, cm = 1, type = "norm", d.buffer = NULL)

Arguments

img

Object of class RasterSpack or RasterBrick.

rd

Object of class Date with img observation dates.

ot

Object of class Date with reference dates.

cm

Number of deviations from the target date. Default is 1.

type

One of "norm" or "pheno" or "pheno2".

d.buffer

Search buffer (expressed in days).

Value

A list.

Details

The function uses a multi-layer raster object to build a composite. It looks at a ginve set of dates (e.g. GPS tracking dates) and estimates a reference date to build the composite for defined by the median of ot. The median is then used to estimate Median Absolute Deviation (MAD) which specifies the size of the buffer set aroung the target date within which bands will be considered. Here, cm is used as a multiplier to enlarge the temporal buffer. Alternatively, a user define temporal buffer is allowed by using the keyword d.buffer. If ot countains only one element, the function will use it as a reference date. In this case, if d.buffer is NULL the function will set it to 30 by default. The way how the function handles temporal information depends on the type keyword. If set to norm, the function will search for the nearest possible dates within the temporal buffer. However, if pheno is set, then the day of the year will be given priority. Thus, if multi-year raster data is provided, older data with a DOY closer to the target that will be used when possible. The output provides: #'

  • value - composite of target images

  • dates - per pixel date code

  • count - pixel count of dates

  • na.count - count of NA values

  • target - target date

  • mad - temporal buffer

If pheno2 is used, for each pixel, the function wilhin 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 proSat

Examples

Run this code
# NOT RUN {
 require(raster)

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

 # raster dates
 rd = seq.Date(as.Date("2013-01-01"), as.Date("2013-12-31"), 45)

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

 # build composite
 r.comp <- rsComposite(rsStk, rd, ot, d.buffer=90)

# }

Run the code above in your browser using DataCamp Workspace