sigmaAvg: Estimate the Average Backscattering Cross Section

Description Usage Arguments Details Value See Also Examples

View source: R/sigmaAvg.R

Description

Estimate the average backscattering cross section, <sigma_bs>, as the mean of the backscattering cross section, sigma_bs, weighted by the number of targets in each target strength bin.

Usage

1
sigmaAvg(TSdf, TSrange, columnPattern = "X[[:punct:]]", prefixLen = 2)

Arguments

TSdf

A data frame with some of the columns containing information on the number of targets detected, named according to the target strength bin, in dB.

TSrange

A numeric vector of length 2, the range in dB by which to constrain the target strengths used in the estimation of the average backscattering cross section.

columnPattern

A character scalar containing a regular expression to be matched to the names of TSdf, identifying those columns with information on the number of targets detected. Case is ignored. The default, "X[[:punct:]]", identifies columns that start with an upper or lower case X followed by any punctuation mark, e.g., "x.", "X_". See regex

prefixLen

An integer scalar giving the number of characters in the prefix of the column names identified by columnPattern to be removed, such that the only part of the name remaining is numeric, default 2.

Details

The numeric portion of the column names of TSdf identified by columnPattern, represent a bin of target strengths (TS) in dB. These TS values are converted to backscattering cross section, sigma_bs in m^2, using TS2sigma. The average backscattering cross section, <sigma_bs> in m^2, is then calculated as the mean of all the sigma_bs within the range of TSrange, weighted by the number of targets in each bin.

The numeric part of the column names are assumed to represent negative values in the dB scale, e.g., x.90 represents -90 dB.

Value

A numeric vector of the average backscattering cross section, <sigma_bs>, one for each row in TSdf.

See Also

TS2sigma, regex

Examples

1
2
mydf <- data.frame(a=letters[1:4], x.80=0:3, x.90=1:4, x.100=c(0, 1, 0, 1))
sigmaAvg(TSdf=mydf, TSrange=c(-105, -85))

JVAdams/EchoNet2Fish documentation built on Feb. 15, 2021, 4:27 a.m.