track3D

Reconstruct a track from pitch, heading and depth data, given a stating position


Matlab & Octave

Will come soon!

R

track <- track3D(z,phi,psi,sf,r=0.001,q1p=0.02,q2p=0.08,q3p=1.6e-05,tagonx,tagony,enforce=T,x,y)

This function will use data from a tag to reconstruct a track by fitting a state space model using a Kalman filter. If no x,y observations are provided then this corresponds to a pseudo-track obtained via dead reckoning and extreme care is required in interpreting the results.

Input var Description Units Default
z is a vector with depth over time (in meters, an observation)metersN/A
phi is a vector with pitch over time (in Radians, assumed as a know covariate)radiansN/A
psi is a vector with heading in radiansradiansN/A
sf is a scalar defining the sampling rate (in Hz)HzN/A
r is the observation error. The default is 0.001N/A0.001
q1p is the speed state error. The default is 0.02N/A0.02
q2p is the depth state error. The default is 0.08N/A0.08
q3p is the x and y state error. The default is 1.6e-05N/A1.6e-05
tagonx is the Easting of starting position (in meters, so requires projected data)metersN/A
tagony is the Northing of starting position (in meters, so requires projected data)metersN/A
enforce is a logical statement. If true, then speed and depth are kept strictly positivelogicalN/A
x is the direct observations of Easting (in meters, so requires projected data)metersN/A
y is the observations of Northing (in meters, so requires projected data)metersN/A
Output var Description Units
p is the smoothed speedsm/s
fit.ks is the fitted speedsm/s
fit.kd is the fitted depthsmeters
fit.xs is the fitted xsN/A
fit.ys is the fitted ysN/A
fit.rd is the smoothed depthsmeters
fit.rx is the smoothed xsN/A
fit.ry is the smoothed ysN/A
fit.kp is the kalman a posteriori state covarianceN/A
fit.ksmo is the kalman smoother varianceN/A
  1. Output sampling rate is the same as the input sampling rate.
  2. Frame: This function assumes a [north,east,up] navigation frame and a [forward,right,up] local frame. In these frames, a positive pitch angle is an anti-clockwise rotation around the y-axis. A positive roll angle is a clockwise rotation around the x-axis. A descending animal will have a negative pitch angle while an animal rolled with its right side up will have a positive roll angle.
  3. This function output can be quite sensitive to the inputs used, namely those that define the relative weight given to the existing data, in particular regarding (x,y)=(lat,long); increasing q3p, the (x,y) state variance, will increase the weight given to independent observations of (x,y), say from GPS readings
  4. The underlying state space model being fitted to the data is described in “Estimating speed using the Kalman filter… and beyond”, equations 5 and 6 a LATTE internal report available from TAM

Matlab & Octave

Will come soon!

R

p <- a2pr(A=beaked_whale$A$data) 
h <- m2h(M=beaked_whale$M$data,A=beaked_whale$A$data) 
track=track3D(z=beaked_whale$P$data,phi=p$p,psi=h$h,
                 sf=beaked_whale$A$sampling_rate,r=0.001,q1p=0.02,
                 q2p=0.08,q3p=1.6e-05,tagonx=1000,
                 tagony=1000,enforce=T,x=NA,y=NA)
par(mfrow=c(2,1),mar=c(4,4,0.5,0.5))
plot(-beaked_whale$P$data,pch=".",ylab="Depth (m)",xlab="Time")
plot(track$fit.rx,track$fit.ry,xlab="X",ylab="Y",pch=".")
points(track$fit.rx[c(1,length(track$fit.rx))],
               track$fit.ry[c(1,length(track$fit.rx))],pch=21,bg=5:6)
legend("bottomright",cex=0.7,legend=c("Start","End"),col=c(5,6),pt.bg=c(5,6),pch=c(21,21))

bugs@animaltags.org Last modified: 10 May 2017

  • tagwiki/tools/processing/track3d.txt
  • Last modified: 2017/08/08 16:45
  • by das39