HAC-package {HAC}R Documentation

Read acoustic HAC raw data

Description

The HAC data format is a binary format containing so-called tuples. A tuple can hold various sorts of information depending on the tuple type. For instance tuples exist to specify positions, echosounder information and acoustic signal data etc. This R package can read, write and manipulate the HAC data format.

Details

Package: HAC
Type: Package
Version: 1.0
Date: 2013-01-01
License: GPL
LazyLoad: yes

Author(s)

Kasper Kristensen and Casper Berg

Maintainer: <kaskr@imm.dtu.dk> <cbe@aqua.dtu.dk>

References

http://biblio.uqar.qc.ca/archives/30005500.pdf

Examples

require(HAC)

## Example file
hacfile <- system.file("hac","Hac-test_000001.hac",package="HAC")

## Step 1. Read hac data into R
hac <- readHAC(hacfile)
print(hac)

## Step 2. Select sub-components
## e.g. "softwarechannel==i"
i <- 3
pingdata <- ( subset(hac,softwarechannel==i & type==10000) )
channel <- ( subset(hac,softwarechannel==i & type==9001) )
echosounder <- ( subset(hac,echosounder==channel$echosounder & type==901) )

## Step 3. Parse the binary data
print( parseHAC(pingdata) )
info <- parseHAC(channel)[5:7]
s <- ( parseHAC(pingdata)$"Sample value" )
s[s>0] <- NA  ## discard positive dB values
sec <- parseHAC(pingdata)$"Time CPU ANSI";sec <- sec-min(sec)
flip <- function(x)t(x[nrow(x):1,])
image(sec,1:nrow(s),flip(s),axes=FALSE,ylab="sample")
axis(1)
at <- seq(nrow(s),1,by=-100)
axis(2,at=at,labels=nrow(s)-at)
box()
legend("topright",legend=paste(names(info),unlist(info)))

[Package HAC version 1.0 Index]