write.noise.cruise: Estimates and writes the noise in av underwater acoustic...

View source: R/write.noise.cruise.R

write.noise.cruiseR Documentation

Estimates and writes the noise in av underwater acoustic system like Simrad EK60, ME70, MS70 or SX90, based on Holmin et al. 2013: "Estimation and simulation of multibeam sonar noise".

Description

Estimates and writes the noise in av underwater acoustic system like Simrad EK60, ME70, MS70 or SX90, based on Holmin et al. 2013: "Estimation and simulation of multibeam sonar noise".

Usage

write.noise.cruise(
  con = NULL,
  esnm = NULL,
  treat = c("bgns", "pdns", "nrns", "hins"),
  event_p = NULL,
  t_p = NULL,
  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,
  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,
  event_a = NULL,
  t_a = NULL,
  filter = dnorm(-20:20, sd = 4),
  nsdn = 1000,
  farv = 1000,
  surface = 451:500,
  turns = 114,
  k = 5,
  q = c(1000, 100),
  beta_school = 2e-04,
  ind = list(-(1:100), NULL),
  max.memory = 2e+09,
  ...
)

Arguments

con

is the path to the file to which the noise estimates schould be written. If con = = NULL, no data is written to file (only returned from the function). If con = = TRUE, the data is written to the default file located in the directory "Noise/Main" in the cruise directory, and named with the cruise name and the events used to estimate the various noise types.

esnm

is the name of the acoustical instrument, given as a four character string. Currently implemented are "EK60", "ME70", "MS70" and "SH80"/"SX80"/"SH90"/"SX90" (may be given in lover case).

treat

is a vector of strings naming the noise types to estimate, where "bgns" is the background noise, "pdns" is the periodic noise, "nrns" is the near range noise, and "hins" is the high intensity noise.

event_p

is the identifier of the event for the noise in passive mode. 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.

t_p

is the identifier of the time points for the noise in passive mode. 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.

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.

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' and 'upperpar' are the lower, start and upper parameter values representing the magnitude, kurtosis and phase, respectively, where the magnitude is given relative to '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.

event_a

is the identifier of the event for the noise in active mode. 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.

t_a

is the identifier of the time points for the noise in active mode. 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.

filter

is the kernel used when smoothing the near range noise of each beam.

nsdn

is the number of standard deviation above the mean nrea range noise for each beam, defining the values that are set to 0. The beam is traced from the sonar and out, and at the first value below the threshold, the near range noise is set to zero for all values at and beyond this value.

farv

is the number of far voxels used for the calclulation of the mean and standard deviation used when assigning zeros to the smoothed near range noise. For farv = 13, the 13 farthest non-missing values are used for each beam.

surface

is a vector of indexes for the beams affected by the surface noise (extrapolated in the near range noise estimation).

turns

is a numeric giving the length of the runs, causing 'turns' pings to be read at each step in the function.

k

is a numeric giving the width of the medians across pings, used in runmed() inside get.hins.event_small().

q

is either a single numeric, or a vector of length 2, givin the start and end point in the linear function along beams defining the threshold times the median filtered values in each direction above which data are classified as high intensity noise.

beta_school

is a single numeric representing a typical high school value. Only values above 'beta_school' can be classified as high intensity noise. 'beta_school' assures that spikes due to for example fish in very silent regions of the data are not classified as high intensity noise.

ind

is a list of indexes, as given to subset_TSD(), used to select the subset over which the estimation of high intensity noise is done. Defaulted to exclude the first 100 voxels along each beam.

max.memory

puts a restiction on the mempry occupied by the function, prompting a call to the user to approve is exceeded.

...

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


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