Supplement to Perlut, N.G., Klak. K, Rakhimberdiev, E. 2017 Geolocator data reveals the migration route and wintering location of the Caribbean Martin. - Wilson Journal of Ornithology 000: 000-000.
library(devtools) install_github("SWotherspoon/SGAT") install_github("SWotherspoon/BAStag") # the latest FLightR: install_github("eldarrak/FLightR") # the version we used is here: install_github("eldarrak/FLightR@0.4.5") # CRAN version may be a couple of month out of date: install.packages('FLightR') library(BAStag) library(FLightR)
download.file("https://git.io/vDfJl", "S1_Carribean_martin.lux") d.lux<-luxTrans("S1_Carribean_martin.lux") names(d.lux) <- c("Datetime", "Light") d.lux$Light <- log(d.lux$Light) threshold <- 1.5 offset = 15 lightImage(d.lux, offset = offset, zlim = c(0,12)) # Calibration Coordinates lon.calib <- -61.2534 lat.calib <- 15.2417 start<-c(lon.calib, lat.calib) twl <- preprocessLight(d.lux, threshold, offset = offset, lmax = 12) library(FLightR) TAGS.twilights.raw<-BAStag2TAGS(d.lux, twl, threshold=threshold, filename='tmp.csv')
Now yo can TAGS.twiligths you have just created or download one we made
download.file("https://git.io/vDfe6", "S2_TAGS_format.csv") Proc.data<-get.tags.data("S2_TAGS_format.csv")
# search for calibration periods plot_slopes_by_location(Proc.data, location=start) abline(v=as.POSIXct("2012-05-10")) abline(v=as.POSIXct("2013-03-20")) abline(v=as.POSIXct("2012-08-05")) abline(v=as.POSIXct("2013-06-20")) # Calibrate tag Calibration.periods<-data.frame(calibration.start=as.POSIXct(c("2012-05-10", "2013-03-20")), calibration.stop=as.POSIXct(c("2012-08-05","2013-06-20")), lon=start[1], lat=start[2]) Calibration<-make.calibration(Proc.data, Calibration.periods, model.ageing=TRUE)
Grid<-make.grid(left=-66, bottom=-20, right=-40, top=25, distance.from.land.allowed.to.use=c(-Inf, Inf), distance.from.land.allowed.to.stay=c(-Inf, 50))
all.in<-make.prerun.object(Proc.data, Grid, start=start, Calibration=Calibration) # ~ 45 mean run time Result<-run.particle.filter(all.in, threads=6, nParticles=1e6, known.last=FALSE) save(Result, file="Result.with.ageing.model.RData")
map.FLightR.ggmap(Result, seasonal.donut.location = "bottomleft") plot_lon_lat(Result)
stationary.migration.summary(Result) # takes ~ 10 minutes
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.