get_dgIdx: Get datagram indices from EK* raw files

View source: R/get_dgIdx.R

get_dgIdxR Documentation

Get datagram indices from EK* raw files

Description

Find the datagram types and lengths, and their respective indices in EK* raw files.

Usage

get_dgIdx(raw)

Arguments

raw

A raw vector imported via read.EK_raw or an EK* raw file name.

Details

In EK* raw files, the first 4 bytes before every datagram contain its length (dgLen), which is repeated after the datagram data and before the length of the next datagram. So, for skipping from one datagram to the next, it takes 4 + dgLen + 4 + 1. Within each datagram, the first 4 bytes give its name (dgType: CON0, NME0, RAW0, etc.), followed by the time (next 8 bytes), and then the datagram data according to its type. The output of this fuction is key for extracting configuration data (header and transceiver information), nmea sentences, and acoustic raw data (received power and angles).

Value

A data frame with datagram types (CON0, NME0, RAW0, etc.) and lengths, and most importantly, the indices where each datagram is located.

Author(s)

Héctor Villalobos.

Examples

if(interactive()){
dgIdx <- get_dgIdx("D20130504-T083828.raw")
head(dgIdx)
} 

hvillalo/echogram documentation built on Oct. 2, 2023, 7:28 a.m.