dsdive.align.obs: Realign observations of a dive to the time scale of the dive

Description Usage Arguments Examples

View source: R/dsdive.align.obs.R

Description

Satellite tag observations of a dive record depths at regular intervals, irrespective of whether or not an animal is diving. Given initial and final offsets offset and offset.tf, respectively, this function will shift the satellite-tag observation times so that they are referenced with respect to the start of the dive (i.e., t=0). Observations in depths will be trimmed from the output if they exceed the times implied by the offsets.

Usage

1
dsdive.align.obs(depths, times, t.stages, offset, offset.tf)

Arguments

depths

Indices of observed depth bins

times

Times at which each of depths was observed

t.stages

Stage transition times for the dive; will be used to compute the dive stage for each observation

offset

Amount of time by which times over or under reports the true time within the dive of each depths observation

offset.tf

Amount of time by which the last time over or under reports the true duration of the dive.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
data('dive.sim')
attach(dive.sim)
attach(params)

t.stages = sim$times[c(FALSE, diff(sim$stages)==1)]
  
dsdive.align.obs(depths = sim.obs$depths, times = sim.obs$times, 
                 t.stages = t.stages, offset = -300, 
                 offset.tf = -300)

detach(params)
detach(dive.sim)

jmhewitt/dsdive documentation built on May 29, 2020, 5:18 p.m.