[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.
Get the development version from github:
# install.packages("devtools")
devtools::install_github("LuisLauM/grec")Or install the CRAN version
install.packages("grec")Next, we show an example of the use of getGradients 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 <- getGradients(x = exampleSSTData)
out_chl <- getGradients(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)- Improvements on
getGradientsmethod forSpatRasterclass inputs.
- Minor corrections on documentation and demo files.
- We are changing the name of the
detectFrontsfunction togetGradients. However, for backwards compatibility,detectFrontswill still be available until v2.0.0. - Adding new methods for
getGradients: Agenbag-1 and Agenbag-2. - Some minor improvements in documentation and code.
- Compatibility with imagine >= 2.0.0.
- New method for SpatRast objects (from terra package).
- Improvements on all methods.
ConvolNormalization = FALSEby default now indetectFrontsfunction.
- Corrections in Belkin and O'Reilly method (GX and GY kernel orientation).
- Adding methods for
SpatRast(from terra package) objects. - Support for Raster- objects will be retired since next versions of grec.
- Improving methods for
arrayobjects. ConvolNormalizationargument is now set asFALSEby default indetectFrontsfunction.- Minor corrections and improvements in efficiency.
- Improvements on the way to work with matrix, arrays, list and RasterLayer objects.
- Correcting some bugs regarded with methods.
- Include
ConvolNormalizationargument and enable normalization of convolutions as default. - Add documentation of methods.
- Improvements on the way to extract matrix data from RasterLayer object.
- Correcting a bug when RasterLayer has not in-memory loaded data (e.g. RasterLayer gotten from read a tif file).
- Add documentation for NW_USA_SST data.
- Some corrections in demos.
- Include a new example data set for SST: NW_USA_SST
- Testing normalization inside B&O method.
- Several changes and improvments on package structure.
finalSmoothandcontrolargumentsdetectFrontswere deleted.extraParamsfunction were deleted. Now, available advanced arguments will be showed in help.- Help document for
detectFrontswere updated. - Another little corrections and improvements.
- Now,
detectFrontsfunction has themethodargument, using by default the Belkin & O'Reilly (2009) algorithm. - Some little corrections.
- Modifications on the title of package.
- New set of exampling data (
grecExData). - Changes how the
detectFrontsalgorithm works internally.
- Change function name: from
fromDetectiontodetectFronts. - Change several argument names on
detectFrontsfunction. thresholdsargument has been replaced byqLimits. Check help ofdetectFrontsfunction for details.- On
detectFrontsfunction, the final smooth application is optional now, controling byfinalSmoothargument. - Now
detectFrontsis a method for classes:matrix,arrayandRasterLayer. - Bugs and corrections.
- First Public Release