Description Usage Arguments Details Value Author(s) References Examples
Calculate past, present, or future position using "dead reckoning" Bowditch (1995). Specifically, the function calculates the "course steered" and the "course made good" (if end position is known).
1 2 3 |
speed |
an object containing the values for measured speed (i.e. speed through water). (Note: this
is assumed to be horizontal speed (i.e. no pitch), unless specified in the |
heading |
an object containing the values for measured heading. Can be one of c("degree", "radian"). |
angle |
Unit of angular measure for |
ret |
Does the animal return to the same position as where it started? (i.e. (0,0)) |
depth |
an object containing the values for measured depth (e.g pressure sensor, or altitude sensor).optional. |
pitch |
an object containing the values for calculated pitch. Both the |
startcoords |
Coordinates for known location at the start of the track, |
endcoords |
Coordinates for known location at the end of the track, |
coordsystem |
Coordinate system of |
speedhorizontal |
Indicates how the input speed values should be handled. Default is
|
See Bowditch (1995) for a complete discussion of dead reckoning and navigation. This function extends traditional navigation calculations by providing the flexibility for 3-dimensional parameters common in animal tracking data.
Object of class dr
, which is a list with the following components:
CSx |
a numeric vector with the x-coordinates for the calculated course steered. Position ascertained through "dead reckoning". |
CSy |
a numeric vector with the y-coordinates for the calculated course steered. Position ascertained through "dead reckoning". |
CMGx |
a numeric vector with the x-coordinates for the calculated course made good. Will be |
CMGy |
a numeric vector with the y-coordinates for the calculated course made good. Will be |
depth |
a numeric vector of depth (or altitude), which is the same as the user input. Depth should be in the same units as x and y (preferably meters). |
speedh |
speed horizontal. A numeric vector of corrected horizontal speed values. If |
speedmg |
speed made good. A numeric vector of speed made good values. These are the speeds between observations after correcting the animal track for a course made good |
drift |
the speed of the current that resulted in the course steered. This is the distance between the course steered end location and the known (i.e. real) end location, divided by time. This represents the speed of the prevailing current, which is assumed to be constant |
errordistance |
This is the distance between the course steered end location and the known (i.e. real) end location |
set |
compass direction of the current. 0 <= |
coordsystem |
The coordinate system of the output coordinates (i.e. |
Ed Farrell <edward.farrell27@gmail.com>
Bowditch, N. (1995), The New American Practical Navigator. Bethesda, MD: Defense Mapping Agency Hydrographic Topographic Center.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | ## Import the "missionbay2" dataset. See help(missionbay2)
## for full documentation.
data(missionbay2)
trial.1 <- missionbay2[missionbay2$trial == 1,]
trial.2 <- missionbay2[missionbay2$trial == 2,]
trial.3 <- missionbay2[missionbay2$trial == 3,]
trial.4 <- missionbay2[missionbay2$trial == 4,]
## Calculate the course made good for the four trials. Each returns
## to the starting position.
CS1 <- dead_reckoning(trial.1$speed, trial.1$heading_geo,angle="radian")
CS2 <- dead_reckoning(trial.2$speed, trial.2$heading_geo,angle="radian")
CS3 <- dead_reckoning(trial.3$speed, trial.3$heading_geo,angle="radian")
CS4 <- dead_reckoning(trial.4$speed, trial.4$heading_geo,angle="radian")
## Plot the course steered for each trial.
plot(CS1$CSx,CS1$CSy,type='l',col='blue',xlab="X-coordinate (unprojected)",
ylab="Y-coordinate (unprojected)",ylim=c(-400,150))
lines(CS2$CSx,CS2$CSy,col='green')
lines(CS3$CSx,CS3$CSy,col='red')
lines(CS4$CSx,CS4$CSy,col='magenta')
legend(-300,100,legend=c("Run1","Run2","Run3","Run4"),col=c("blue","green",
"red","magenta"),lty=c(1,1,1,1),bty="n")
title('Course Steered for Mission Bay Trials')
grid()
## Plot the course steered vs. course made good
plot(CS1$CSx,CS1$CSy,type='l',col='blue',xlab="X-coordinate (unprojected)",
ylab="Y-coordinate (unprojected)",ylim=c(-400,150))
lines(CS1$CMGx,CS1$CMGy,col='black')
t.set <- paste("Track 1, Set Angle: ",as.character(round(CS1$set*(180/pi),2)))
t.drift <- paste("Track 1, Drift: ",as.character(round(CS1$drift,2))," m/s")
t.error <- paste("Track 1, Error Distance: ",as.character(round(CS1$errordistance,2))," m")
title(paste(t.set,"\n",t.drift,"\n",t.error))
legend(-300,100,legend=c("Course Steered","Course Made Good"),
col=c("blue","black"),lty=c(1,1),bty="n")
grid()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.