FLightR: an r package for reconstructing animal paths from solar geolocation loggers
Summary
- Solar geolocators are relatively cheap and simple tools which are widely used to study the migration of animals, especially birds. The methods to estimate the geographic positions from the light‐intensity patterns collected by these loggers, however, are still under development.
- The accurate reconstruction of the annual schedules and movement patterns of individual animals requires analytical methods which provide estimates of daily locations, distances between the locations and the directions of movement, with measures of their uncertainty.
- The new r package FLightR meets all these requirements. It enables refined and statistically validated estimations of movement patterns of birds. Here, we present main features of this advanced package.
Introduction
Modern migration ecology builds on movement data of animals equipped with tracking devices (Nathan et al. 2008). Among the tracking devices, solar geolocators, i.e. archival tags that record light‐level data over time, are now the smallest, cheapest and most widely used for migratory birds (Bridge et al. 2011, 2013). After their introduction to bird tracking about a decade ago (Croxall et al. 2005; Shaffer et al. 2006), data collected by these devices continue to dominate the field, with several tens of papers published in 2016. The greatest challenge in the use of solar geolocators is the stage of data processing: how are the sequences of light‐level records that they store best converted into geographic positions (Lisovski et al. 2012b; Rakhimberdiev 2016)?
The reconstruction of the annual schedules and movement patterns is particularly challenging in animals with complex movements. Among these, migratory birds travel across a range of latitudes, with varying speeds and at different times of day (Alerstam 1990). The animals will use a variety of habitats, which may include sheltered ones, such as tropical forests. Here, recorded day lengths will be shorter than true day lengths, which will bias the estimation of geographic positions. Many seasonal movements along south‐north axes occur during the equinoxes (Alerstam 1990), a time when day lengths are equal all over the world. So just when it matters, the day lengths are uninformative. All these factors add to the imprecision of the results (Lisovski et al. 2012b).
An additional layer of complexity is generated by the need to not only know the geography of routes but also the timing of the movements, i.e. the schedules of individual animals (Marra et al. 2005; Conklin et al. 2010). We need to be able to distinguish between the states of being stationary and moving. Finally, to be confident about what can, and what cannot be concluded, we also should know the uncertainty of the estimates of place and time. The existing analytical tools for processing solar geolocation data, i.e. Trackit (Nielsen & Sibert 2007), TripEstimation (Sumner, Wotherspoon & Hindell 2009; Sumner & Wotherspoon 2016; currently replaced with SGAT), GeoLight (Lisovski, Hahn & Hodgson 2012a) and BAStag (Wotherspoon, Sumner & Lisovski 2016a) take care of some of the analytic demands, but never of all of them (see Rakhimberdiev et al. 2015 for review).
Here, we introduce FLightR, a new r (R Core Team 2016) package for analysis of light‐level data obtained from solar geolocators. Compared with analogous packages, FLightR provides refined results in terms of accuracy and precision of calculated positions (Rakhimberdiev et al. 2016). The space and time estimates are improved by: (i) a hidden Markov chain model, computed via particle filter algorithm (Kitagawa 1996), and (ii) a template fit observation model allowing the use of all available measurements around twilights (Ekstrom 2004). The hidden Markov model provides better position estimates as it utilizes not only positional information from the current twilight but also uses information from the previous and next twilights propagated through a movement model (Patterson et al. 2008). The template fit observation model relies on the principles of change in light irradiance with sun angle (‘template’) and is robust to varying degrees of shading (Ekstrom 2007).
FLightR works with light‐level data collected by the various kinds of solar geolocators (Intigeo tags by Migrate Technology Ltd, GDL tags by Swiss Ornithological Institute), and particularly by the narrow light band tags (mk tags produced British Antarctic Survey, Biotrack Ltd and Migrate Technology Ltd). To avoid states of residence over water or over land surfaces in land‐ and seabirds, respectively, spatial and spatio‐behavioural masks can be used. For every twilight, FLightR provides estimated positions of a tracked animal, the probability of its actually moving between twilights (over day and over night) and the distances and directions of movement. For the estimated positions, distances and directions, FLightR evaluates uncertainty. Rakhimberdiev et al. (2015) provide details on the package and compare its performance with other existing packages. FLightR is a cross‐platform package, its core functions are implemented in parallel framework. FLightR is available on CRAN (https://CRAN.R-project.org/package=FLightR), the development version and examples of the use of this package are on GitHub at www.github.com/eldarrak/FLightR#readme.
Workflow
The workflow consists of the following steps: (i) annotation of twilights (done outside the FLightR package) and data import into the FLightR, (ii) calibration of the data, (iii) assignment of spatial extents, (iv) the setting up of priors and the compiling of the final data object, (v) running the particle filter analysis and (vi) visualization of the results. In Appendix S1, Supporting Information (also available on GitHub https://git.io/viTDY), we demonstrate the routine using a track of a black‐tailed godwit (Limosa limosa limosa) migrating from its breeding site in the Netherlands to its wintering area in Spain. The raw dataset used is available from Rakhimberdiev et al. (2016).
Data preparation and import
The analysis of geolocation data begins with the definition of the twilight events, i.e. the sunrises and the sunsets. As this procedure is implemented in several software packages, we did not incorporate it into FLightR. Instead, we recommend the use of the appropriate functions in other r packages, e.g. preprocessLight functions in BAStag (Wotherspoon, Sumner & Lisovski 2016a) and TwGeos (Wotherspoon, Sumner & Lisovski 2016b), twilightCalc in GeoLight (Lisovski, Hahn & Hodgson 2012a), or online service http://tags.animalmigration.org.
The FLightR uses the ‘TAGS’ format to read the annotated twilight data as input. This format represents an agreed general annotation of twilight data by the National Centre for Ecological Analysis and Synthesis working group ‘Establishing an open‐source animal‐tracking analysis platform for archival geolocators’ (https://www.nceas.ucsb.edu/featured/bridge). TAGS online service (http://tags.animalmigration.org) saves the data in the TAGS format. If one uses the r packages GeoLight, BAStag or TwGeos, the annotated twilights need to be exported to TAGS, for which the following functions in FLightR can be used: GeoLight2TAGS, BAStag2TAGS or TwGeos2TAGS. The function get.tags.data reads comma separated file in TAGS format, detects tag type, checks whether the light data are log‐transformed, transforms them back from the log scale if needed, and returns it as a FLightR data object.
Calibration
Geolocator units measure light levels with varying precision, thus for each device calibration the relationship between the measured and the expected light levels needs to be established. This relationship can be estimated, using data, recorded during a so‐called calibration period, i.e. when a tag stays in a known position, usually before the animal has left the area, where it is tagged or to where it returned the next year. The use of both periods (i.e. at the beginning and the end) helps to account for any ageing of the tag. For example, when an opacification of the transparent shell of a light sensor results in a decreased sensitivity of the device. The desired calibration period should at least be a few days. As a tagged animal will not always stay in a known location for a long enough period, we recommend ‘rooftop calibration’ (with a geolocator left outside in an open location) prior to, and preferably also after, tagging.
(eqn 1)
(eqn 2)
and its uncertainty
. A joint probability of
,
and calibration parameters Zcalib and σzcalib used as the likelihood of occurrence of the animal at the grid point k during the twilight i (see Rakhimberdiev et al. 2015 for details).
The calibration parameters are based on the data recorded during calibration periods. The user needs to create a data frame where the geographic coordinates of the calibration location, and the start and end dates of the calibration period, are specified. A calibration object is compiled with the function make.calibration from the data frame containing calibration periods and locations and the data object, obtained with the get.tags.data. The calibration object contains all necessary calibration parameters for the tag.
If the start and end dates are not known precisely, they can be visually determined. For this, the calibration slopes for sunsets and sunrises are obtained and plotted for every day of the tracking period based on the assumption that the tag remained at the same (calibration) location. Because calibration slopes reflect the adequacy of the light level measured by the device, as long as the tagged animal stayed put at the calibration location, they will vary little until the animal moves off. The function plot_slopes_by_location aims to help with the search for appropriate calibration periods.
In some cases, e.g. when animal is tagged during a 24‐h polar day or when it migrates immediately after tagging, traditional calibration at a known site is not possible. With the function find.stationary.location, FLightR determines the unknown locations where the animal has been resident. Here, the approach of FLightR is similar to the Hill‐Ekstrom calibration (Lisovski et al. 2012b) implemented in GeoLight (Lisovski, Hahn & Hodgson 2012a); the function searches for location at which the spread of errors in the slopes of twilights during resident period is minimal. This approach critically depends on a tagged animal being resident for at least few weeks.
Assign spatial extent
FLightR estimates the positions of an animal at twilights on a regular spatial grid with distance between nodes of approximately 50 km. The function make.grid sets up a spatial grid delimited by user‐defined boundaries (the parameters left, bottom, right and top). Limiting the spatial extent of the grid will speed‐up the calculations as it decreases the number of grid nodes that need to be processed. When the tagged animal simply cannot occur or stay between two subsequent twilights over particular areas, e.g. open water for a landbird, additional parameters distance.from.land.allowed.to.use and distance.from.land.allowed.to.stay can be specified. Each of these parameters requires a vector of two numbers: the minimal and the maximal distances (in km) from shoreline, at which the animal is allowed to occur/stay. For example, distance.from.land.allowed.to.use = c(‐100, 500) means that the bird is allowed to fly in a range between 100 km inland, and up to 500 km from the shoreline over the sea.
Prepare the model for run
The function make.prerun.object compiles a complex object to be used in the main run. This object incorporates all the four objects created at earlier steps: (i) the light data with the detected twilight events (Proc.data), (ii) the spatial parameters (Grid), (iii) the geographic coordinates of the location where the tracking has started (start) and (iv) the calibration parameters (Calibration). There are five parameters in the function (Bayesian priors for the movement model) that can potentially be manipulated: (i) the probability of migration (Decision, defaults to 0·1 for any transition), (ii) the direction of movement (Direction), (iii) the concentration parameter of von Mises distribution (Kappa, defaults to uniform distribution), (iv) the mean and (v) the SD of the distance that can be covered between subsequent twilights (M.mean, defaults to 300 km, and M.sd, 500 km). In case the relevant biological knowledge exists, prior values can be changed for all transitions, or for specified time periods.
Particle filter run
The function run.particle.filter estimates the coordinates with credible intervals and probabilities of migration for each twilight event (runs ~ 45 min for godwit example on a standard workstation). For each twilight it also generates a probability of occurrence on the spatial grid, and a probability of transition between nodes. The output contains a table of positions at each twilight ($Results$Quantiles) and their statistics (mean, median values and credible intervals), a table of parameters of the movement model ($Results$Movement.results) and posterior distribution at every twilight and at every transition between twilights. At the end of the run, the function plots a simplified preliminary map with a resulting track, i.e. mean positions at each twilight, connected with a line.
Estimation of arrival and departure times
The function find.times.distribution derives the time at which an animal arrived or departed from an area of interest together with the measure of its uncertainty. A simple summary of the periods of residence and movement can be generated by the function stationary.migration.summary.
Visualization of the results
The results, i.e. the estimated probability of an animal occurring at a particular latitude and longitude on each day, can be plotted with the plot_lon_lat (Fig. 1). The function map.FLightR.ggmap provides a map with the most probable positions (combinations of the most probable latitude and longitude) for each day (Fig. 2). This function automatically detects the optimum spatial scale for the maps.


The function plot_util_distr is intended to plot utilization distributions, i.e. the probabilities of occurrence of an animal in space and time. It can also be restricted to a specific twilight or a group of twilights to visualize the most likely locations during certain periods such as the winter quarters or the migratory flights (Fig. 3). To do this, the initial and final dates of a period of interest are specified, e.g. the arrival and departure dates obtained during the procedure described in section ‘estimation of arrival and departure times’.

Known limitations
FLightR is well suited for most of the data obtained from solar geolocators, but there still are a few known limitations of its use. (i) FLightR does not estimate latitudes well under high shading, e.g. for birds that are always under dense canopy. (ii) Narrow band mk tags have a limited amount of information when set for >5 min fixing interval. They still work well for low shading tracks, but fail earlier than other tags when shading increases. (iii) Imposed spatial masks restrict the effectiveness of particle filter and sometimes brings it to local minima, so we advise to always carefully compare results obtained with and without masks.
Conclusions
FLightR is an advanced tool for the analyses of geolocation data. Compared with the existing solar geolocation packages it: (i) provides positions and migratory schedules of animals with a higher precision including estimates of their uncertainty, (ii) efficiently works with narrow light band tags, (iii) allows for systematic changes in the habitats used throughout an individual annual cycle, minimizing the bias from various shading regimes, (iv) estimates behavioural state parameters that describe a bird as either sedentary or on the move and (v) allows the modelling of movements of an animal over unsuitable habitats with restrictions on the animal staying there. These features enable the ecological interpretation of bird‐tracking data.
Authors’ contributions
E.R. and A.S. conceived methodology, E.R. implemented the methodology as an r package. J.K. and E.R. wrote package documentation. J.K. led the writing of the manuscript. T.P. collected the example data and contributed to the writing. All authors tested the software, contributed critically to the drafts and gave final approval for publication.
Acknowledgements
We thank all participants of NCEAS Project 12663 ‘Establishing an open‐source animal‐tracking analysis platform for archival geolocators’, but especially, David Winkler, Eli Bridge, Nathaniel Seavy and Simeon Lisovski. E.R. and T.P. were supported by a grant to T.P. from Waddenfonds (‘Metawad’, WF209925).
Data accessibility
FLightR is available on CRAN (https://CRAN.R-project.org/package=FLightR) and GitHub (https://github.com/eldarrak/FLightR#readme).
References
Citing Literature
Number of times cited according to CrossRef: 26
- Rosalind Renfrew, Dan Kim, Noah Perlut, Michael D. Cadman, Migration tactics of a long-distance migratory songbird from across a continental breeding range, The Wilson Journal of Ornithology, 10.1676/1559-4491-131.4.735, 131, 4, (735), (2020).
- Mo A. Verhoeven, A.H. Jelle Loonstra, Alice D. McBride, Joost M. Tinbergen, Rosemarie Kentie, Jos C.E.W. Hooijmeijer, Christiaan Both, Nathan R. Senner, Theunis Piersma, Variation in Egg Size of Black-Tailed Godwits, Ardea, 10.5253/arde.v107i3.a7, 107, 3, (291), (2020).
- T Hromádková, V Pavel, J Flousek, M Briedis, Seasonally specific responses to wind patterns and ocean productivity facilitate the longest animal migration on Earth, Marine Ecology Progress Series, 10.3354/meps13274, 638, (1-12), (2020).
- Michael E. Johns, Pete Warzybok, Jaime Jahncke, Mark Lindberg, Greg A. Breed, Oceanographic drivers of winter habitat use in Cassin’s Auklets, Ecological Applications, 10.1002/eap.2068, 30, 3, (2020).
- A. Roberto-Charron, J. Kennedy, L. Reitsma, J. A. Tremblay, R. Krikun, K. A. Hobson, J. Ibarzabal, K. C. Fraser, Widely distributed breeding populations of Canada warbler (Cardellina canadensis) converge on migration through Central America, BMC Zoology, 10.1186/s40850-020-00056-4, 5, 1, (2020).
- Shannon Whelan, Scott A. Hatch, David B. Irons, Alyson McKnight, Kyle H. Elliott, Increased summer food supply decreases non-breeding movement in black-legged kittiwakes, Biology Letters, 10.1098/rsbl.2019.0725, 16, 1, (20190725), (2020).
- Chris P. F. Redfern, Richard M. Bevan, Use of sea ice by arctic terns Sterna paradisaea in Antarctica and impacts of climate change, Journal of Avian Biology, 10.1111/jav.02318, 51, 2, (2020).
- Fei Liu, Yaping Wang, Yifang Zhang, Jiande Lin, Qiong Su, Junrong Shi, Xuefang Xie, Shuquan Liang, Anqiang Pan, A Facile Carbon Quantum Dot‐Modified Reduction Approach Towards Tunable Sb@CQDs Nanoparticles for High Performance Sodium Storage, Batteries & Supercaps, 10.1002/batt.201900167, 0, 0, (2020).
- Simeon Lisovski, Silke Bauer, Martins Briedis, Sarah C. Davidson, Kiran L. Dhanjal‐Adams, Michael T. Hallworth, Julia Karagicheva, Christoph M. Meier, Benjamin Merkel, Janne Ouwehand, Lykke Pedersen, Eldar Rakhimberdiev, Amélie Roberto‐Charron, Nathaniel E. Seavy, Michael D. Sumner, Caz M. Taylor, Simon J. Wotherspoon, Eli S. Bridge, Light‐level geolocator analyses: A user's guide, Journal of Animal Ecology, 10.1111/1365-2656.13036, 89, 1, (221-236), (2019).
- Rocío Joo, Matthew E. Boone, Thomas A. Clay, Samantha C. Patrick, Susana Clusella‐Trullas, Mathieu Basille, Navigating through the r packages for movement, Journal of Animal Ecology, 10.1111/1365-2656.13116, 89, 1, (248-267), (2019).
- Jeroen Reneerkens, Tom S. L. Versluijs, Theunis Piersma, José A. Alves, Mark Boorman, Colin Corse, Olivier Gilg, Gunnar Thor Hallgrimsson, Johannes Lang, Bob Loos, Yaa Ntiamoa‐Baidu, Alfred A. Nuoh, Peter M. Potts, Job Horn, Tamar Lok, Low fitness at low latitudes: Wintering in the tropics increases migratory delays and mortality rates in an Arctic breeding shorebird, Journal of Animal Ecology, 10.1111/1365-2656.13118, 89, 3, (691-703), (2019).
- Chris P. F. Redfern, Richard M. Bevan, Overland movement and migration phenology in relation to breeding of Arctic Terns Sterna paradisaea, Ibis, 10.1111/ibi.12723, 162, 2, (373-380), (2019).
- Theunis Piersma, Ornithology from the Flatlands, Ardea, 10.5253/arde.v107i2.a9, 107, 2, (115), (2019).
- Maurizio Sarà, Salvatore Bondì, Ana Bermejo, Mathieu Bourgeois, Mathias Bouzin, Javier Bustamante, Javier Puente, Angelos Evangelidis, Annagrazia Frassanito, Egidio Fulco, Giuseppe Giglio, Gradimir Gradev, Matteo Griggio, Lina López‐Ricaurte, Panagiotis Kordopatis, Simeon Marin, Juan Martínez, Rosario Mascara, Ugo Mellone, Stefania C. Pellegrino, Philippe Pilard, Stefano Podofillini, Marta Romero, Marco Gustin, Nicolas Saulnier, Lorenzo Serra, Athanassios Sfougaris, Vicente Urios, Matteo Visceglia, Konstantinos Vlachopoulos, Laura Zanca, Jacopo G. Cecere, Diego Rubolini, Broad‐front migration leads to strong migratory connectivity in the lesser kestrel (Falco naumanni), Journal of Biogeography, 10.1111/jbi.13713, 46, 12, (2663-2677), (2019).
- Andrew M. Ramey, Brian D. Uher‐Koch, Andrew B. Reeves, Joel A. Schmutz, Rebecca L. Poulson, David E. Stallknecht, Emperor geese (Anser canagicus) are exposed to a diversity of influenza A viruses, are infected during the non‐breeding period and contribute to intercontinental viral dispersal, Transboundary and Emerging Diseases, 10.1111/tbed.13226, 66, 5, (1958-1970), (2019).
- Mattia Pancerasa, Matteo Sangiorgio, Roberto Ambrosini, Nicola Saino, David W. Winkler, Renato Casagrandi, Reconstruction of long-distance bird migration routes using advanced machine learning techniques on geolocator data, Journal of The Royal Society Interface, 10.1098/rsif.2019.0031, 16, 155, (20190031), (2019).
- Mo A. Verhoeven, A. H. Jelle Loonstra, Nathan R. Senner, Alice D. McBride, Christiaan Both, Theunis Piersma, Variation From an Unknown Source: Large Inter-individual Differences in Migrating Black-Tailed Godwits, Frontiers in Ecology and Evolution, 10.3389/fevo.2019.00031, 7, (2019).
- Nathan R. Senner, Mo A. Verhoeven, José M. Abad-Gómez, José A. Alves, Jos C. E. W. Hooijmeijer, Ruth A. Howison, Rosemarie Kentie, A. H. Jelle Loonstra, José A. Masero, Afonso Rocha, Maria Stager, Theunis Piersma, High Migratory Survival and Highly Variable Migratory Behavior in Black-Tailed Godwits, Frontiers in Ecology and Evolution, 10.3389/fevo.2019.00096, 7, (2019).
- Simeon Lisovski, Zoltán Németh, John C. Wingfield, Jesse S. Krause, Keith A. Hobson, Nathaniel E. Seavy, Jennifer Gee, Marilyn Ramenofsky, Migration pattern of Gambel’s White-crowned Sparrow along the Pacific Flyway, Journal of Ornithology, 10.1007/s10336-019-01685-4, (2019).
- Gunnar R. Kramer, David E. Andersen, David A. Buehler, Petra B. Wood, Sean M. Peterson, Justin A. Lehman, Kyle R. Aldinger, Lesley P. Bulluck, Sergio Harding, John A. Jones, John P. Loegering, Curtis Smalling, Rachel Vallender, Henry M. Streby, Population trends in Vermivora warblers are linked to strong migratory connectivity , Proceedings of the National Academy of Sciences, 10.1073/pnas.1718985115, 115, 14, (E3192-E3200), (2018).
- Vojtěch Brlík, Mihaela Ilieva, Simeon Lisovski, Christian C. Voigt, Petr Procházka, First insights into the migration route and migratory connectivity of the Paddyfield Warbler using geolocator tagging and stable isotope analysis, Journal of Ornithology, 10.1007/s10336-018-1557-9, 159, 3, (879-882), (2018).
- H Schultz, RJ Hohnhold, GA Taylor, SJ Bury, T Bliss, SMH Ismar, AC Gaskett, CD Millar, TE Dennis, Non-breeding distribution and activity patterns in a temperate population of brown skua, Marine Ecology Progress Series, 10.3354/meps12720, 603, (215-226), (2018).
- Max L. Witynski, David N. Bonter, Crosswise migration by Yellow Warblers, Nearctic‐Neotropical passerine migrants, Journal of Field Ornithology, 10.1111/jofo.12237, 89, 1, (37-46), (2018).
- Tong Mu, Pavel S. Tomkovich, Egor Y. Loktionov, Evgeny E. Syroechkovskiy, David S. Wilcove, Migratory routes of red‐necked phalaropes Phalaropus lobatus breeding in southern Chukotka revealed by geolocators, Journal of Avian Biology, 10.1111/jav.01853, 49, 7, (2018).
- Simeon Lisovski, Heiko Schmaljohann, Eli S. Bridge, Silke Bauer, Andrew Farnsworth, Sidney A. Gauthreaux, Steffen Hahn, Michael T. Hallworth, Chris M. Hewson, Jeffrey F. Kelly, Felix Liechti, Peter P. Marra, Eldar Rakhimberdiev, Jeremy D. Ross, Nathaniel E. Seavy, Michael D. Sumner, Caz M. Taylor, David W. Winkler, Simon J. Wotherspoon, Michael B. Wunder, Inherent limits of light-level geolocation may lead to over-interpretation, Current Biology, 10.1016/j.cub.2017.11.072, 28, 3, (R99-R100), (2018).
- David W. Winkler, Facundo A. Gandoy, Juan I. Areta, Marshall J. Iliff, Eldar Rakhimberdiev, Kevin J. Kardynal, Keith A. Hobson, Long-Distance Range Expansion and Rapid Adjustment of Migration in a Newly Established Population of Barn Swallows Breeding in Argentina, Current Biology, 10.1016/j.cub.2017.03.006, 27, 7, (1080-1084), (2017).




