filter: Gapfill and filter time series satellite data

filterVIR Documentation

Gapfill and filter time series satellite data

Description

Estimate missing values using smooth gap-filled time series data with a two-stage Savitzky-Golay smoothing filter.

Usage

  filterVI(x, ...)

  fillVI(x, method = "natural")

Arguments

x

numeric or SpatRaster representing time series signal to be filtered

method

type of spline to be used. Possible values are "fmm", "natural", "periodic", "monoH.FC" and "hyman"

...

additional arguments: method: as above p1: filter order for first pass n1: filter length for first pass (must be odd) p2: filter order for inner passes n2: filter length for inner passes (must be odd)

Details

Performs smoothing of time series data using a two pass Savitzky-Golay smoothing filter. Second pass is an iterative method to minimize the difference between actual and fitted values that are significantly lower than the actual values. Missing values designated as NA are automatically interpolated with spline. For more details on the arguments see splinefun and sgolayfilt.

Value

Filtered signal of length(x)

Examples

  
# apply on single pixel
#vi <- ....
#s <- filterVI(vi)

# for time series raster 
#fevi <- app(evi, filterVI)

rspatial/luna documentation built on Feb. 3, 2024, 4:40 a.m.