Vignette for oXim package

Wencheng Lau-Medrano

2018-05-07

oXim

Oxycline Index from Matrix Echograms

This package is built to take echogram data from Echopen software outputs and calculate oxycline depth limits using image-filtering algoriths.

oXim uses imagine algorithms, which includes median-filter and 2D-convolution implemented on Rcpp (C++) because the applicaion of this filters to echograms is very intensive and time expensive due to the size of echograms. oXim allows to change some parameters for filtering routines using an easily format (a table, data.frame object).

An echogram can be described as a visual representation of an acoustic variable, usually refered to the backscattering energy received after the emision of sound pulse to the water. Actualy, there are many softwares oriented to explore and analyze echogram data from echosounders as Echoview. One of them is Echopen, which was developed by IRD people under a Matlab environment and include libraries and routines for reading, integrate and cleaning databases from multibeam echosounders. oXim requires Echopen outputs as inputs for work.

Installation

For installing oXim, as follows:

install.packages("oXim")

Examples

Read data from Echopen outputs

For reading data, it is necesary to specify Echopen outputs files (.m extension).

# Set directories where the Echopen's outputs are located
fileMode <- list(fish38_file   = system.file("extdata", "fish38.mat", package = "oXim"),
                 fluid120_file = system.file("extdata", "fluid120.mat", package = "oXim"),
                 blue38_file   = system.file("extdata", "blue38.mat", package = "oXim"))

# Read echograms (echoData object)
echoData <- readEchograms(fileMode = fileMode)

Once the files have been read, output object will be of class echoData what means there are methods oriented to show main information (print), make a summary of data inside echograms (summary) and visualize the echograms as an image (plot). Then, methods for echoData objects are shown:

# Print method
print(echoData)
## 
## Number of echograms:  1 
## 
## For echogram 1:
##  Range lon:  From 74.167° W to 74.113° W 
##  Range lat:  From 17.218° S to 17.187° S 
##  Range time: From 2011-09-12 00:54:29 to 2011-09-12 01:18:37
# Print method
summary(echoData)
## 
## Number of echograms:  1 
## 
## For echogram 1:
##      sA  lon lat time    
##  Min.    -122.847838078502   -74.1670020438338   -17.2183843552502   2011-09-12 00:54:29 
##  1st Qu. -91.48610383837 -74.154484856821    -17.2110507617438   2011-09-12 00:59:50 
##  Median  -85.3753876401532   -74.1398684390605   -17.2023851057272   2011-09-12 01:06:06 
##  Mean    -84.4136168763668   -74.1398792121302   -17.2023691823165   2011-09-12 01:06:09 
##  3rd Qu. -76.5332763026333   -74.1252598362854   -17.1937421676507   2011-09-12 01:12:21 
##  Max.    -53.0739241697383   -74.1131603941313   -17.1872333333333   2011-09-12 01:18:37 
# Plot method
plot(echoData)

Calculate oxycline depth limits

For oxycline depth calculation, getOxyrange function provides an easy-to-use way for applying median-filter and 2D convolution-based filters. This filters are explained below:

Both noiselessFilter and definerFilter do not use all values of neighborhood but only those located within diagonals of it. That because better results were found weighting up cells of diagonals.

For calculate oxycline depth limits from echoData objects, getOxyrange should be applied as follows:

# Calculate oxycline limits (oxyclineData object)
oxyLimits <- getOxyrange(fluidMatrix = echoData)
## Message: 
## No filter-setting object or file detected. OXim will use default filter configuration.

Likewise with readEchograms function, getOxyrange will return an object of class oxyclineData with their associated methods (print, summary and plot).

print(oxyLimits)
## 
## For echogram 1:
##  Range lon:  From 74.167° W to 74.113° W 
##  Range lat:  From 17.218° S to 17.187° S 
##  Range time: From 2011-09-12 00:54:29 to 2011-09-12 01:18:37 
##  Range oxycline depth:   From 13.1 m to 96.7 m
summary(oxyLimits)
## 
## Number of database:  1 
## 
## For database 1:
##      lon lat limits  time    
##  Min.    -74.1670020438338   -17.2183843552502   -96.65281501463 2011-09-12 00:54:29 
##  1st Qu. -74.154484856821    -17.2110507617438   -73.768283354504    2011-09-12 00:59:50 
##  Median  -74.1398684390605   -17.2023851057272   -71.4729481031704   2011-09-12 01:06:06 
##  Mean    -74.1398792121302   -17.2023691823165   -69.6828014847638   2011-09-12 01:06:09 
##  3rd Qu. -74.1252598362854   -17.1937421676507   -69.0546695430253   2011-09-12 01:12:21 
##  Max.    -74.1131603941313   -17.1872333333333   -13.057148349645    2011-09-12 01:18:37 
plot(oxyLimits)
## [inverse distance weighted interpolation]