calibrate_tdr: Calibrate CEFAS data

Description Usage Arguments Value Examples

View source: R/calibrate_tdr.R

Description

calibrate_tdr is a wrapper for calibrateDepth. CEFAS tags record depth in bursts, so this function uses a split-apply-combine approach to calibrate each FastLog individually. Tags have an error of +/-1m, so for shallow diving birds the error may be greater than the depth of the dive. To avoid losing these dives, the "surface" is assumed to be at the shallowest point in each FastLog, not at 0. For tags with a 1m threshold, this may bias dive depths shallower.

Usage

1
2
calibrate_tdr(tdr, deployid, rate = 0.1, surface_thr = 0.1,
  depth_thr = 0.2, dur_thr = 0.5)

Arguments

tdr

data.frame. Use read_cefas to parse CEFAS file.

deployid

character. Deployment identifier.

rate

numeric. Sampling rate for FastLog events.

surface_thr

numeric. Threshold for surface noise.

depth_thr

numeric. Minimum depth to qualify as a dive.

dur_thr

numeric. Minimum duration to qualify as a dive.

Value

data.frame with columns

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
# Load metadata
metadata_path <- system.file('extdata',
                             'MOC2015PFSHmetadata.csv',
                             package = 'pfsh.dive')
metadata <- readr::read_csv(metadata_path)

# Read CEFAS output
tdr_path <- system.file('extdata',
                         paste0(metadata$TDR_filename[1], '.CSV'),
                         package = 'pfsh.dive')
tdr <- read_cefas(tdr_path,
                  metadata$Deployed[1],
                  metadata$Recovered[1])

# Calibrate TDR data
calib_tdr <- calibrate_tdr(tdr, metadata$DeployID[1])

mczapanskiy-usgs/pfsh.dive documentation built on May 26, 2019, 5:42 p.m.