get.bgns.event: Estimates the mean of exponentially distributed background...

View source: R/get.bgns.event.R

get.bgns.eventR Documentation

Estimates the mean of exponentially distributed background noise for each beam of an underwater acoustic system, based on the lower fraction of the values specified by 'prob', and writes the result to file in the TSD format if 'con' is given.

Description

Estimates the mean of exponentially distributed background noise for each beam of an underwater acoustic system, based on the lower fraction of the values specified by 'prob', and writes the result to file in the TSD format if 'con' is given.

Usage

get.bgns.event(
  con = NULL,
  event = NULL,
  cruise = 2009116,
  t = NULL,
  esnm = "MS70",
  treat = c("bgns", "pdns"),
  noise = NULL,
  fftthreshold = 0.145,
  nsind = 0.75,
  acfq = 100,
  prob = 0.2,
  type = 6,
  tries = c(10, 10),
  thr = 0.001,
  trim = 0.1,
  search = 4,
  kurtosis = c(0.1, 3),
  reffan = 16,
  pdns_scale = 1e-14,
  lowerpar = c(0.001, 0.001, -2 * pi),
  startpar = c(1, 2, 3),
  upperpar = c(1000, 6, 4 * pi),
  kern = NULL,
  high = Inf,
  ...
)

Arguments

con

is the connection object or a character string naming the output file.

event

is the identifier of the event. Given either as the number of the event, a string contained in the name of the event, or the path of the event directory. More than one event may be given, in a vector.

cruise

is the identifier of the cruise. Given either as the specification used by IMR (yyyynnn), or the path to the directory containing the event to be read.

t

is the identifier of the time points. Given either as a vector of integers between 1 and the number of pings in the event, or a vector of time points given as strings "yyyymmddHHMMSS.FFF" or "HHMMSS.FFF" from which the range of the time points are extracted. If t=="all", all files are read and if t=="none" no action is done. If more than one event is given, 't_bgns' must be given as a list of vectors.

esnm

is the name of the acoustical instrument, given as a four character string. See sonR_implemented() for the implemented systems. May be given in 'data', and in lower case.

noise

is either a list of the elements 'harm' and 'badb', representing the harmonics of the periodic beams (where the non-periodic beams are set to 1) and the the vector identifying the periodic beams, composed of 0's for non-periodic beams and 1's for periodic beams, respectively; or a character string representing the path to a directory or file from which this information should be read. If not given, the periodic nature and the harmonics of the beams are estimated from the passive data.

fftthreshold

is the threshold value for the height of the highest peak in spectral density relative to the zero frequency, identifying the preiodic beams as those with mean across pings exceeding the 'fftthreshold'.

nsind

is a specification of the voxels used in the estimation, given either as a list as input to pplot3d.event(), a vector to be intersected with the sequence of voxels along beams, a single integer > 1 representing the "farthes nsind voxels along each beam", a single numeric <=1 representing the proportion of the farthest voxels along the beams compared to the length of the beams, of sonething else (like NULL) implying taking all voxels into account:.

acfq

is the frequency of the alternating current generating the periodic noise.

prob

is the lower fraction of tha data in each beam to be used in the estimation of background noise. Lower value gives higher variance in the estimate and higher value gives stronger influence from periodic noise.

type

is the type of quantile method used in meanexp.quantile() in get.bgns.event(). Defaulted to 6, which was found reasonable for exponential data.

tries

specifies the number of tries in the iteration used when estimating the background noise and the periodic noise (vector of two values where the first limits the iteration between estimation of the background noise and the periodic noise and the second limits the oprimization of the periodic noise).

thr

is the threshold for the absoulte difference between the previous and the current estimate, divided by the current estimate, at which the above mentioned iteration stops.

trim

is used in mean() for estimation of the kurtosis parameter of the periodic noise 'pns2'.

search

is the number of tries in the iteration above which the optimal estimate is searched for in the intermediate estimates, by the value with the lowest sum of the rank of the funciton value of the iteration (bgns) and of the optimization (pdns).

kurtosis

is a vector of the lower and upper limit for the kurtosis estimate, outside of which estimates (of all parameters) are discarded.

reffan

is the reference fan used in the calculation of the phase angles.

pdns_scale

is used for scaling the data to ensure best performance of the optimization, and corersponds to the mean of the data (default if set to NULL).

lowerpar, startpar, upperpar

are the lower, start and upper parameter values representing the magnitude, kurtosis and phase, respectively, where the magnitude is given relative to 'pdns_scale'.

kern

is either a vector of wieghts summing to 1, specifying the smoothing of the spectral frequency used to identify the harmonics, or a single numeric = 1, specitying a Gaussian kernel with sd=1.

high

is used in resampleHigh() in get.bgns.event() to reduce the impact from unusually high values in the fft.

...

variables used in write.TSD() (such as 'ow' for overwriting existing files).


arnejohannesholmin/sonR documentation built on April 14, 2024, 11:39 p.m.