absindex {albatross}R Documentation

Functions of absorbance data

Description

Calculate absorption coefficients and/or absorbance data at given wavelengths, spectral slopes, and their ratios.

Usage

  absindex(
    x, abs.path, unit = c("log10", "m^-1"), out.A = 254,
    out.a = c(350, 355, 374, 443),
    out.a.ratio = list(c(250, 365), c(465, 665)),
    out.slope = list(c(275, 295), c(350, 400)),
    out.slope.ratio = list(c(275, 295, 350, 400)),
    out.slope.nrmse = FALSE
  )

Arguments

x

Absorption data, either a list of two-column matrix-like objects with wavelengths in first column and values in second column, or a multi-column matrix-like object with wavelengths in first column and values in all other columns. Can be named in order to match with the abs.path values, see feemife for details.

abs.path

A numeric vector of optical path lengths for every spectrum, in centimetres. Defaults to 1 for all samples. If specified, should be either named, with names matching x, or unnamed and containing exactly the same number of path lengths.

unit

Specifies whether x contains absorbance (⁠log10⁠; A = \log_{10}\frac{I_0}{I}; unitless) or absorption coefficients (⁠m^-1⁠; \alpha = \frac{\ln \frac{I_0}{I}}{l} ; [\mathrm{m}^{-1}]).

out.A

Return absorbance values at the wavelengths given as a numeric vector.

out.a

Return absorption coefficients at the wavelengths given as a numeric vector.

out.a.ratio

Return ratios of absorption coefficients at the wavelengths given as a list of two-element numeric vectors. For every pair of wavelengths, \frac{\alpha(\lambda_1)}{\alpha(\lambda_2)} is returned.

out.slope

Return spectral slopes at wavelength ranges given as a list of two-element numeric vectors. See the slope.method for the description of how spectral slopes are computed.

out.slope.ratio

Return ratios of spectral slopes for pairs of wavelength ranges given as a list of four-element numeric vectors. For every list element, the value returned is \frac{S(\lambda_1, \lambda_2)}{S(\lambda_3, \lambda_4)} .

out.slope.nrmse

When computing slopes, also return the root-mean-square error for the models providing them, divided by the range of the response: \frac{1}{y_\mathrm{max} - y_\mathrm{min}} \sqrt{\sum_{i=1}^n\frac{(\hat{y}_i - y_i)^2}{n}} .

Details

Currently, the spectral slopes are calculated by fitting a linear model \ln \alpha = b_0 - b_1 \lambda and returning b_1 as the slope. See (Twardowski, Boss, Sullivan, and Donaghay 2004) for a discussion of the calculation methods for spectral slopes.

Requested wavelengths missing from the original grid are interpolated using spline. NA values are returned outside the original wavelength range.

Value

A data.frame with one row per sample, containing the following columns:

sample

Names or numbers of the samples.

A.<wavelength>

Absorbance values, for every wavelength in out.A.

a.<wavelength>

Absorption coefficients, for every wavelength in out.a.

aR.<wl[1]>.<wl[2]>

Ratios of absorption coefficients, for every wl in out.a.ratio.

S.<wl[1]>.<wl[2]>

Spectral slopes, for every wl in out.slope.

NRMSE.S.<wl[1]>.<wl[2]>

If out.slope.nrmse is TRUE, root-mean-square errors normalised by the range of the absorption coefficients for the models providing spectral slopes.

SR.<wl[1]>.<wl[2]>.<wl[3]>.<wl[4]>

Ratios of spectral slopes, for every wl in out.slope.ratio.

References

Twardowski MS, Boss E, Sullivan JM, Donaghay PL (2004). “Modeling the spectral shape of absorption by chromophoric dissolved organic matter.” Marine Chemistry, 89(1), 69-88. doi:10.1016/j.marchem.2004.02.008.

See Also

feemife

Examples

  data(feems)
  absindex(absorp)

[Package albatross version 0.3-7 Index]