Learn R Programming

remote (version 1.2.3)

denoise: Noise filtering through principal components

Description

Filter noise from a RasterStack by decomposing into principal components and subsequent reconstruction using only a subset of components

Usage

denoise(
  x,
  k = NULL,
  expl.var = NULL,
  weighted = TRUE,
  use.cpp = TRUE,
  verbose = TRUE,
  ...
)

Value

a denoised RasterStack

Arguments

x

RasterStack to be filtered

k

number of components to be kept for reconstruction (ignored if expl.var is supplied)

expl.var

minimum amount of variance to be kept after reconstruction (should be set to NULL or omitted if k is supplied)

weighted

logical. If TRUE the covariance matrix will be geographically weighted using the cosine of latitude during decomposition (only important for lat/lon data)

use.cpp

logical. Determines whether to use Rcpp functionality, defaults to TRUE.

verbose

logical. If TRUE some details about the calculation process will be output to the console

...

additional arguments passed to stats::princomp()

See Also

anomalize(), deseason()

Examples

Run this code
data("vdendool")
vdd_dns <- denoise(vdendool, expl.var = 0.8)

opar <- par(mfrow = c(1,2))
plot(vdendool[[1]], main = "original")
plot(vdd_dns[[1]], main = "denoised")
par(opar)

Run the code above in your browser using DataLab