Smooth data with a Savitzky-Golay smoothing filter using sgolayfilt
.
Usage
filter_savgol(
raster,
p = 3,
n = p + 13 - p%%2,
m = 0,
ts = 1,
extent = NULL,
ext = NULL,
filename = NULL
)
Arguments
- raster
a terra SpatRaster of normalized data
- p
filter order.
- n
filter length (must be odd).
- m
return the m-th derivative of the filter coefficients.
- ts
time scaling factor.
- extent
an extent or SpatVector used to subset SpatRaster. Defaults to the entire SpatRaster.
- ext
character, a graphic format extension.
- filename
NULL (default) to write automatically into products, provide full path and ext to override.