Title: | A Bi-Dimensional Implementation of the Empirical Mode Decomposition for Spatial Data |
---|---|
Description: | This implementation of the Empirical Mode Decomposition (EMD) works in 2 dimensions simultaneously, and can be applied on spatial data. It can handle both gridded or un-gridded datasets. |
Authors: | Pierre Roudier [aut, cre] |
Maintainer: | Pierre Roudier <[email protected]> |
License: | GPL-3 |
Version: | 0.1-1 |
Built: | 2024-11-14 02:58:28 UTC |
Source: | https://github.com/pierreroudier/spemd |
Internal function, initiates the neighbourhood relationships between the points in the processed data set.
create.neig(data.set, nb.nn = 4, duplicate = "remove", verbose = FALSE)
create.neig(data.set, nb.nn = 4, duplicate = "remove", verbose = FALSE)
data.set |
Data set to create neighbourhood from. |
nb.nn |
Number of nearest neighbours. Defaults to 4. |
duplicate |
Ignored. |
verbose |
Prints progress information messages. Defaults to FALSE. |
Pierre Roudier
Internal function, explicitely returns a list with the tri objects of the extrema.
extract.extrema(tri.obj, n.extrema.min = 1)
extract.extrema(tri.obj, n.extrema.min = 1)
tri.obj |
. |
n.extrema.min |
. |
Pierre Roudier
Internal function, finds regional extrema on a irregularly sampled data set
extrema.irr(data.set, gridded.data, neig = NULL, zcol = "z", duplicate = "remove", nb.nn = 4, thresh.extrema = 1, verbose = FALSE)
extrema.irr(data.set, gridded.data, neig = NULL, zcol = "z", duplicate = "remove", nb.nn = 4, thresh.extrema = 1, verbose = FALSE)
data.set |
. |
gridded.data |
. |
neig |
Neighbourhood object. |
zcol |
Name of the column containing the data. |
duplicate |
What to do with duplicates. Defaults to 'remove'. |
nb.nn |
Number of nearest neighbours to take into account if data is on a grid. Defaults to 4. |
thresh.extrema |
Significative threshold for the extrema. Defaults to 1. |
verbose |
Prints progress information messages. Defaults to FALSE. |
Pierre Roudier
Internal function, returns the mean enveloppe of a spatial dataset.
return.mean.enveloppe(extrema, data, zcol = "z", method = "splines", n.pts.spline = 3, verbose = TRUE)
return.mean.enveloppe(extrema, data, zcol = "z", method = "splines", n.pts.spline = 3, verbose = TRUE)
extrema |
. |
data |
. |
zcol |
Name of the column containing the data. |
method |
Interpolation method. Currently only 'splines' is supported. |
n.pts.spline |
. |
verbose |
Prints progress information messages. Defaults to TRUE. |
Pierre Roudier
2D EMD for spatial objects
spEMD(data, zcol = "z", method = "splines", n.imf.max = 10, n.sp.max = 5, n.extrema.min = 1, stoprule = "mean.imf", stoprule.extrema = TRUE, thresh.extrema = 1, tol = 0, diff.nb.extrema = 0.05, abs.nb.extrema = 5, nb.nn = 4, n.pts.spline = 4, neig = NULL, save_neig = TRUE, verbose = TRUE)
spEMD(data, zcol = "z", method = "splines", n.imf.max = 10, n.sp.max = 5, n.extrema.min = 1, stoprule = "mean.imf", stoprule.extrema = TRUE, thresh.extrema = 1, tol = 0, diff.nb.extrema = 0.05, abs.nb.extrema = 5, nb.nn = 4, n.pts.spline = 4, neig = NULL, save_neig = TRUE, verbose = TRUE)
data |
Input dataset, either a 'data.frame' or a 'Spatial*DataFrame' |
zcol |
Name of the column containing the attribute of interest. |
method |
Interpolation method. Currently only 'splines' is supported. |
n.imf.max |
Maximum depth of decomposition (maximum number of IMF). |
n.sp.max |
Number of iterations in the sifting process. |
n.extrema.min |
Minimum number of extrema. |
stoprule |
Rule used to stop the EMD process. Currently only 'mean.imf' is implemented. |
stoprule.extrema |
Should 'spEMD' checks for the number of extrema to be similar? Defaults to 'TRUE'. |
thresh.extrema |
Significative threshold for the extrema. Defaults to 1. |
tol |
Value that the avergae of the IMF candidate need to reach so to be considered as a valid IMF. |
diff.nb.extrema |
Percentage limit difference maxima/minima. If smaller, more permissive on the mean of the IMF candidate. |
abs.nb.extrema |
Absolute difference between number of extrema. |
nb.nn |
Number of nearest neighbours to take into account (when data is on a regular grid). |
n.pts.spline |
Number of points to locally interpolate IMFs. |
neig |
Option the re-use a formerly existing neig object in order to save time. |
save_neig |
Option to save the neig object as a .RData file once created. |
verbose |
Prints progress information messages. Defaults to TRUE. |
.
Pierre Roudier
# Getting sample data from the gstat package if (require(gstat)) { library(sp) # Example for gridded data data(ncp.grid, package = 'gstat') coordinates(ncp.grid) <- ~x+y gridded(ncp.grid) <- TRUE res.ncp <- spEMD(ncp.grid, zcol = "depth", thresh.extrema = 0.1, verbose = FALSE) # Plot results spplot(res.ncp[, c('imf1', "imf2", "imf3")]) } #
# Getting sample data from the gstat package if (require(gstat)) { library(sp) # Example for gridded data data(ncp.grid, package = 'gstat') coordinates(ncp.grid) <- ~x+y gridded(ncp.grid) <- TRUE res.ncp <- spEMD(ncp.grid, zcol = "depth", thresh.extrema = 0.1, verbose = FALSE) # Plot results spplot(res.ncp[, c('imf1', "imf2", "imf3")]) } #