EKRaw2TSD: Convert from Simrad or LSSS Profos files to TSD files.

View source: R/EKRaw2TSD.R

EKRaw2TSDR Documentation

Convert from Simrad or LSSS Profos files to TSD files.

Description

EKRaw2TSD Converts from raw data files in the EKRaw format to TSD files, readable by R using the functions read.TSD, resd.TSDs and read.event.

LSSS2TSD Converts from LSSS Profos export files to TSD files, readable by R using the functions read.TSD, read.TSDs and read.event.

Usage

EKRaw2TSD(
  event,
  filenr = "all",
  t = "all",
  cruise = NULL,
  esnm = "MS70",
  eventname = NULL,
  CTD_station = NULL,
  event_tsd = NULL,
  event_sadv = NULL,
  endian = "little",
  dir.data = NULL,
  timeOffset = 0,
  minTimeDiff = Inf,
  drop = TRUE,
  msg = TRUE,
  prenumt = 10,
  hpr0 = NULL,
  Pain = FALSE,
  TVG.exp = 2,
  psze = -7,
  variableRange = TRUE,
  gain = NULL,
  sacr = NULL,
  correctTime = FALSE,
  ow = TRUE,
  dira_offset = 0,
  write = TRUE,
  cali = TRUE,
  toTS = FALSE,
  na.rm = TRUE,
  cleanNMEA = 1,
  mergeFiles = TRUE,
  cores = 1,
  tres = NULL,
  xres = NULL,
  zres = NULL,
  rres = NULL,
  bres = NULL,
  funvbsc = c("median", "mean"),
  funt = c("median", "mean"),
  adds = list(),
  split = TRUE,
  skipAngles = TRUE,
  origin = 1,
  filesize = 3e+08,
  chunksize = 1e+08,
  apply.range.offset = FALSE,
  thr1m = FALSE,
  ...
)

EKRaw2TSDs(
  event,
  esnm = c("SU90", "EK60"),
  dir.type = c("tsd", "Work"),
  cores = 1
)

getSchoolsFromWork(event, esnm = "SU90", esnmLog = NULL, cores = 1)

aggregateSchoolsFromWork(x, by = "sadv", delta = 1, digits = 6)

LSSS2TSD(
  event = NULL,
  filesize = 3e+08,
  chunksize = 1e+08,
  keep.temp = FALSE,
  cores = 1,
  ...
)

Arguments

event

is the identifier of the event, either given as the number of the event, a string contained in the name of the event, or the path of the event directory. If given as a full path to the directory of the raw data, the value of 'esnm' is interpreted from the data. Can also be given as a vector of files directly.

filenr

is the indices of the files to convert.

t

is a vector of the time steps to process in each file.

cruise

is either the idenfication number of the cruise, given as specified by the IMR (yyyynnn), or the path to the directory containing the event to be read.

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.

eventname

is the name of the event, by default deduced from the file path.

CTD_station

is the path to the directory holding the CTD files. If not given (default) the directory is attemptedly set to file.path(Acoustics_datasets_directory(),"CTDs").

event_tsd

is the path to the TSD event, by default deduced from the file path.

endian

is the endian of the file, defaulted to .Platform$endian (changed from "big" by Arne Johannes Holmin 2012-07-31).

dir.data

is the path to the directory in which the projects are stored, defaulted by the variable Acoustics_datasets_directory().

timeOffset

is the time offset of the datagram.

minTimeDiff

is the minimum difference in time betwee two pings.

drop

is TRUE to drop dimensions of the data.

msg

is TRUE to print a time bar during reading.

prenumt

is the number of time steps to reserve in the temporary file sto which data are saved during reading in order to restrict memeory usage. High values result in fewer temporary file but higher CPU time. The default value of 10 should be relatively optimal.

hpr0

is the pressure at sea level, which must be given externally. Defaulted to 101325 pascal.

Pain

is TRUE if pressure "ihpr" is given in Pascal and FALSE if given in decibar relative to surface pressure (10000 Pascal, giving values approximately equivalent to water depth).

TVG.exp

is the exponent of the eamotric spreading of the sound wave, theoretically 2 for Sv and 4 for TS.

psze

is the vertical position of the acoustic instrument, given as a negative value in meters, defaulted to -7.

variableRange

should be set to TRUE for fishery sonars,

gain

optinal gain values to apply to the data, typically from calibration.

sacr

optinal sacorrection values to apply to the data, typically from calibration.

correctTime

is TRUE to correct the data for offset in the time of the pings, determined by the difference in the time of the first ping and the first NMEA time information.

ow

is FALSE to not overwrite existing TSD files.

dira_offset

is an optional offset for the azimuth angle of the beams (useful to get the correct angle of fishery sonars).

write

is FALSE to only return the data and not write to TSD file.

cali

is FALSE to omit any calibration data located in the directory "Calibration" located at the top level of the cruise (alongside "Events"), or the path to a file if preferred.

toTS

is TRUE to apply the TS calibration instead for the Sv calibration.

na.rm

is TRUE to remove missing pings.

cleanNMEA

is FALSE to return the data as read, without shaving off incomplete time steps, 1 to remove incomplete and duplicate time steps, and 2 to additionally clean missing info at the end.

mergeFiles

is FALSE to not merge beams, vessel and rawvessel files at the end of the funciton, but rather keep the individual files.

cores

is an integer specifying the number of cores to run the compression over in parallel (should be lower than the number of cores in the computer).

tres

The time resolution of the compressed data in seconds.

xres

The sailed distance resolution of the compressed data in meters.

zres

The depth resolution of the compressed data in meters.

rres

The range resolution of the compressed data in meters.

bres

The beam resolution of the compressed data in integer number.

funvbsc

is the function to apply in the compression, either given as function or as a string, in which case the strings "mean" and "median" represents fast versions of the functions with the corresponding names (sum()/length() and fastMedian(), respectively).

funt

is the same as funvbsc, but used for averaging vessel data in the new time/distance bins.

adds

is a list of additional data overriding corresponding variables in 'data'

split

used in psx.TSD().

skipAngles

is TRUE to discard electircal angles from the data (saves time).

origin

is either the time index of the origin, or the origin itself, given as c(longitude, latitude).

filesize

is the maximum size of the merged files.

chunksize

is the maximum size of the chunks of file read at the time.

apply.range.offset

Logical:: If TRUE strip the data of samples by the range offset Ro (for raw=1).

thr1m

Logical: If TRUE apply a rule that TVG closer than 1 m should not cause increasedd level (as used in LSSS).

...

For EKRaw2TSD(), arguments passed to combine.TSD() and compr.TSD(), and for LSSS2TSD(), inputs complementing the variables extracted from the files. Several of these are missing in the data as per 2016, such as (numt = number of time steps, and dimensions are given in square brackets):

"numb"

Number of beams [numt], interpreted from the file names

"lenb"

Lengths of the beams [numb, numt], set to the maximum range of the data

"psze"

Position of the transducer below sea surface, negative value [numt], defaulted to -7

"diraSpan"

The span of the sonar, given by the direction of the first and last beam in radians, where 0 is to the starboard side [2], defaulted to c(0, 2*pi)

"asps"

Average speed of sound in m/s [numt], iterated from the range values given the initial guess defaulted to 1480

"bwtx"

Beam width horizontally in radians [numb, numt], required

"bwty"

Beam width vertically in radians [numb, numt], required

"bmmd"

Beam modes, where 0: approximately horizontally oriented disc, like fishery sonar, 1: downward oriented echosounder, 2: downward oriented fan, 3: 3-D sonar, not vertical [numb, numt], required

"freq"

Frequency [numb, numt], sometimes required

"eqba"

Equivalent beam angle [numb, numt], not required

"sacr"

Sa-correction [numb, numt], not required

"tpow"

Transmit power [numt], not required

"gai1", "gai1"

Gain values [numt], not required

keep.temp

is TRUE to delete the temporary files from individual school files.


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