FLightR (version 0.4.5)

find.stationary.location: find undknown calibration location

Description

Functions attempts to find a location where The function attempts to find a location for a time period assuming animal was not moving. Does not work well will shaded data!

Usage

find.stationary.location(Proc.data, calibration.start, calibration.stop, plot = TRUE, initial.coords = NULL, print.optimization = TRUE, reltol = 1e-05)

Arguments

Proc.data
processed data object generated by get.tags.data
calibration.start
POSIXct time when stationary period started
calibration.stop
POSIXct time when stationary period ended
plot
plots every iteration
initial.coords
location vector with initial values for location (longitude and latitude). Should be close (+-2000 km from the real location)
print.optimization
do you want every optimization iteration to be printed? If TRUE - Lon, Lat, Calbration mean and Calibration sd are being printed. Optimization tries to minimze the latter.
reltol
tolerance for optimization, see optim for more details

Details

The idea behind the function is that it tries to minimze variance between slopes for the whole period by optimizing location. It can be seen as an extension of Hill-Ekstrom calibration idea.

Examples

Run this code
#this example takes about 15 minutes to run
## Not run: 
# File<-system.file("extdata", "Godwit_TAGS_format.csv", package = "FLightR")
# Proc.data<-get.tags.data(File)
# plot_slopes_by_location(Proc.data=Proc.data, location=c(5.43, 52.93))
# abline(v=as.POSIXct("2013-08-20")) # end of first calibration period
# abline(v=as.POSIXct("2014-05-05")) # start of the second calibration period
# Location<-find.stationary.location(Proc.data, '2013-07-20', '2013-08-20', initial.coords=c(10, 50))
# ## End(Not run)

Run the code above in your browser using DataLab