View source: R/loadPamguardBinaryFile.R
loadPamguardBinaryFile | R Documentation |
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.
loadPamguardBinaryFile(
fileName,
skipLarge = FALSE,
skipData = FALSE,
debug = FALSE,
keepUIDs = NULL,
convertDate = FALSE,
...
)
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 |
convertDate |
logical flag to convert date from numeric to POSIXct. Defaults to
|
... |
Arguments passed to other functions |
This function returns a list containing two objects. Data contains all the binary data read. fileInfo contains metadata information for the file.
Taiki Sakai taiki.sakai@noaa.gov
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.