Description Details References Examples
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 subset the HAC data format.
See the description of the ICES HAC standard data exchange format, version 1.60.
McQuinn, Ian H., et al. Description of the ICES HAC standard data exchange format, version 1.60. Conseil international pour l'exploration de la mer, 2005. http://biblio.uqar.ca/archives/30005500.pdf
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | require(readHAC)
######################################################################
## Example file
hacfile <- system.file("hac", "Hac-test_000001.hac", package="readHAC")
######################################################################
## Step 1. Read hac data into R
hac <- readHAC(hacfile)
print(hac)
######################################################################
## Step 2. Select sub-components
pingdata <- ( subset(hac, softwarechannel==3 & type==10000) )
channel <- ( subset(hac, softwarechannel==3 & 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)) )
|
Object of class 'HAC' containing 1346 tuples
============================================
Tuple types:
tuple type count
1 Position tuple 20 189
2 Generic Echosounder tuple 901 11
3 Generic Channel tuple 9001 11
4 Ping tuple U-32 10000 714
5 Ping tuple U-32-16-angles 10001 357
6 Split-beam detected single-target tuple 10090 63
7 HAC Signature tuple 65535 1
Identifiers (to select tuples):
$type [ 20, 901, 9001, 10000, 10001, 10090, 65535 ]
$softwarechannel [ 0 - 10 ]
$echosounder [ 1 - 14 ]
$subchannel [ 9, 10 ]
$depthsensor [ ]
$distancesensor [ ]
$attitudesensor [ ]
$time [ 1075308210 - 1075308329 ]
$timefraction [ 140 - 9980 ]
$typeofdata [ 0, 1, 2, 3 ]
$pointer [ 2 - 1173809 ]
$length [ 6, 9, 14, 17, 20, 23, 36, 39, 44, 1094 ]
Tuple size [byte] [length=119] 4366 4366 ... 4366 4366
Tuple type [] [length=119] 10000 10000 ... 10000 10000
Time fraction [s] [length=119] 0.938 0.938 ... 0.938 0.938
Time CPU ANSI C Standard time [s] [length=119] 1075308211 1075308212 ... 1075308328 1075308329
Software channel identifier [] [length=119] 3 3 ... 3 3
Transceiver mode [] [length=119] eavesdropping: the transceiver is receiving while another transceiver is transmitting eavesdropping: the transceiver is receiving while another transceiver is transmitting ... eavesdropping: the transceiver is receiving while another transceiver is transmitting eavesdropping: the transceiver is receiving while another transceiver is transmitting
Ping number [] [length=119] 2520 2521 ... 2637 2638
Detected bottom range [m] [length=119] 61.793 61.786 ... 61.864 61.689
Sample sequence number [] [dim=542x119] 0 0 ... 0 0
...
541 541 ... 541 541
Sample value (> threshold) [dB] [dim=542x119] 18.040415 18.040415 ... 18.040415 18.040415
...
-82.761616 -84.748885 ... -82.432365 -85.60729
Tuple attribute [] [length=119] original original ... original original
Backlink [byte] [length=119] 4376 4376 ... 4376 4376
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.