grec
[G]radient-based [REC]ognition of Spatial Patterns in Environmental Data
Provides algorithms for detection of spatial patterns from oceanographic data using image processing methods based on Gradient Recognition.
Installation
Get the development version from github:
# install.packages("devtools")
devtools::install_github("LuisLauM/grec")Or install the CRAN version
install.packages("grec")Examples
Next, we show an example of the use of detectFronts function:
require(grec)
data(sst)
exampleSSTData <- list(x = sst$longitude,
y = sst$latitude,
z = sst$sst[,,1])
data(chl)
exampleChlData <- list(x = chl$longitude,
y = chl$latitude,
z = chl$chlorophyll[,,1])
# Simple application (over a XYZ list)
out_sst <- detectFronts(x = exampleSSTData)
out_chl <- detectFronts(x = exampleChlData)
# External transformation for chl data
out_chl$z <- log10(out_chl$z)
par(mfrow = c(2, 2), mar = rep(0, 4), oma = rep(0, 4))
image(exampleSSTData, col = colPalette, axes = FALSE)
mtext(text = "Original SST", side = 3, line = -2, adj = 0.99, cex = 1.2)
image(out_sst, col = colPalette, axes = FALSE)
mtext(text = "SST gradient", side = 3, line = -2, adj = 0.99, cex = 1.2)
image(exampleChlData, col = colPalette, axes = FALSE)
mtext(text = "Original Chlorophyll", side = 3, line = -2, adj = 0.99, cex = 1.2)
image(out_chl, col = colPalette, axes = FALSE)
mtext(text = "Chlorophyll gradient\n(log scale)", side = 3, line = -4, adj = 0.99,
cex = 1.2)