gapfill_raster: Fill NA values in Raster* time series by interpolation (gap...

Description Usage Arguments Details Value Note Author(s) References See Also Examples

Description

Fill NA values in Raster* time series

Usage

1
2
3
gapfill_raster(x, w=NULL, t=NULL, timeInfo = orgTime(x), method,
                      lambda = 5000, nIter= 3, outlierThreshold = NULL,
                      df = 6, ws = 2, cl = NULL, filename=rasterTmpFile(),...)

Arguments

x

A Raster-class object to interpolate

w

Optional, a Raster-class object with weight information. See e.g. makeWeights.

t

Optional, a Raster-class object with MODIS 'composite day of the year' data.

timeInfo

object returned by orgTime defining the input and output time stamps to interpolate to.

method

character vector of length 1 with one of the following value: 'spline' for smoothing splines ,'linear' for linear approximation ,'constant' for constant approximation, 'nn' for nearest neighbour , 'whittaker' for whittaked smoothing.

lambda

Yearly lambda value. Default is 5000. See whittaker.raster.

nIter

numeric vector of length 1 giving the number of iterations for the upper envelope fitting ('whittaker' method). Default is 3. See whittaker.raster.

outlierThreshold

Numeric. If provided, outlierTreshold allows to remove outliers before smoothing by fitting a whittaker function and removing values with residuals higher than outlierTreshold.

df

Yearly degree of freedom for 'spline' method. Default is 6. See smooth.spline.raster

ws

window size for the 'fensholt' method. Default to 2. See details

cl

cluster object for parallel processing (do not use it if beginCluster() has been called. Default is NULL

filename

name of the file where the interpolated raster is saved. Default is created through rasterTmpFile

...

arguments passed to writeRaster

Details

The 'fensholt' method fill gaps in a time serie according to the following rule: If t0 is flagged as NA (e.g. cloudy) an average between t-1, t+1 is performed; if only one of t-1 or t+1 is not missing t0 will be replaced by this value. If both t-1 and t+1 are missing then the filter is extended to cover also t-2 and t+2 following the same rules as for t-1 and t+1

Value

A Raster-class object with NA values filled

Note

Most of the code is borrowed from smooth.spline.raster and whittaker.raster

Author(s)

Antoine Stevens & Matteo Mattiuzzi

References

Fensholt, R., Rassmussen, K., Nielsen, T.T., and Mbow, C. (2009). Evaluation of earth observation based long term vegetation trends - Intercomparing NDVI time series trend analysis consistency of Sahel from AVHRR GIMMS, Terra MODIS and SPOT VGT data. Remote Sensing of Environment 113, 1886-1898.

See Also

interpolate_raster

Examples

1
# See interpolate_raster

antoinestevens/MODISExtra documentation built on May 10, 2019, 12:23 p.m.