loadPamguardBinaryFile {PamBinaries}R Documentation

Load Pamguard Binary File

Description

This function will load in the data from a Pamguard binary file. It will figure out the type of data being read based on the header of the file. All functions based on Matlab code written by Michael Oswald.

Usage

loadPamguardBinaryFile(
  fileName,
  skipLarge = FALSE,
  skipData = FALSE,
  debug = FALSE,
  keepUIDs = NULL,
  convertDate = FALSE,
  ...
)

Arguments

fileName

The name of the binary file to be read

skipLarge

Should we skip large parts of binaries? Currently only applicable to whistle, click, and DIFAR data

skipData

Should we skip all data and only read headers and footers?

debug

logical flag to show more info on errors

keepUIDs

If not NULL, a vector of UIDs to read. All UIDs not in this vector will not be read.

convertDate

logical flag to convert date from numeric to POSIXct. Defaults to FALSE for speed, can reduce time by

...

Arguments passed to other functions

Value

This function returns a list containing two objects. Data contains all the binary data read. fileInfo contains metadata information for the file.

Author(s)

Taiki Sakai taiki.sakai@noaa.gov

Examples


# read example whistle data
wmFile <- system.file('extdata', 'WM.pgdf', package='PamBinaries')
whistleData <- loadPamguardBinaryFile(wmFile)
# works the same for different kinds of binary files
clickFile <- system.file('extdata', 'Click.pgdf', package='PamBinaries')
clickData <- loadPamguardBinaryFile(clickFile)
# convert date to POSIXct (default does not because it is faster)
clickPOSIX <- loadPamguardBinaryFile(clickFile, convertDate = TRUE)
clickData$data[[1]]$date
clickPOSIX$data[[1]]$date
# read only the fileInfo portion, has empty $data item
clickInfo <- loadPamguardBinaryFile(clickFile, skipData = TRUE)
# skip reading the large click waveforms, much faster if you dont need them
clickLess <- loadPamguardBinaryFile(clickFile, skipLarge = TRUE)
object.size(clickData)
object.size(clickLess)
# only read specific UID numbers
clickSpecific <- loadPamguardBinaryFile(clickFile, keepUIDs = c(4000006, 4000007))
names(clickSpecific$data)


[Package PamBinaries version 1.9.0 Index]