echogram (version 0.1.1)

match.echogram: Match ping times from two echograms

Description

This function verifies ping times between corresponding echograms from two frequencies, eliminating non-matching and duplicated pings.

Usage

match.echogram(echogram1, echogram2)

Arguments

echogram1

an object of class ``echogram'' as returned by read.echogram.

echogram2

an object of class ``echogram'' from a different acoustic frequency than echogram1 above.

Value

A list with the two matched echograms.

Details

Corresponding echograms refers to data acquired at the same time with different acoustic frequencies. Unmatching pings, i.e. those present in only one frequency, and duplicated pings, are identified by it's associated time and subsequently eliminated.

See Also

add.echogram

Examples

Run this code
# NOT RUN {
# import 38 and 120 kHz data from an HAC file 
hacfile <- system.file("hac", "D20150510-T202221.hac", package = "echogram")
echo1.038 <- read.echogram(hacfile, channel = 1)
echo1.120 <- read.echogram(hacfile, channel = 2)

# Sv matrices have different number of pings
dim(echo1.038$Sv); dim(echo1.120$Sv)

# Apply match ping times
tmp <- match.echogram(echo1.038, echo1.120)

# split the list in the two echograms 
echo1.038 <- tmp$echogram1
echo1.120 <- tmp$echogram2

# number of pings and ping times are now the same for both frequencies
dim(echo1.038$Sv); dim(echo1.120$Sv)
# }

Run the code above in your browser using DataLab