
Convert detections and receiver metadata to a format that ATT accepts.
Source:R/util-convert_glatos_to_att.r
convert_glatos_to_att.RdConvert glatos_detections and glatos_receiver objects to ATT for
compatibility with the Animal Tracking Toolbox
https://github.com/vinayudyawer/ATT, now part of VTrack
https://github.com/RossDwyer/VTrack.
Usage
convert_glatos_to_att(detectionObj, receiverObj, crs = sf::st_crs(4326))Arguments
- detectionObj
A
glatos_detectionsobject (e.g., created by read_glatos_detections) or adata.framecontaining required columns (see glatos_detections).- receiverObj
A
glatos_receiversobject (e.g., created by read_glatos_receivers) or adata.framecontaining required columns (see glatos_receivers).- crs
an object of class
crs(see sf::st_crs) with geographic coordinate system for all spatial information (latitude/longitude). If none provided orcrsis not recognized, defaults to WGS84.
Value
a list of 3 tibbles containing tag detections, tag metadata, and station metadata, to be ingested by VTrack/ATT
Details
This function takes 2 lists containing detection and reciever data
and transforms them into one list containing 3 tibble objects. The input
that AAT uses to get this data product is located here:
https://github.com/vinayudyawer/ATT/blob/master/README.md and our mappings
are found here:
https://github.com/ocean-tracking-network/glatos/issues/75#issuecomment-982822886
in a comment by Ryan Gosse.
Note that the Tag.Detections element of the output can contain
fewer records than detectionObj because detections are omitted if they
do not match a station deployment-recovery interval in receiverObj.
For example, in the walleye data example, walleye_detections contains
7180 rows but Tag.Detectons output only contains 7083 rows.
Examples
#--------------------------------------------------
# EXAMPLE #1 - loading from the vignette data
library(glatos)
wal_det_file <- system.file("extdata", "walleye_detections.csv",
package = "glatos"
)
walleye_detections <- read_glatos_detections(wal_det_file) # load walleye data
rec_file <- system.file("extdata", "sample_receivers.csv",
package = "glatos"
)
rcv <- read_glatos_receivers(rec_file) # load receiver data
ATTdata <- convert_glatos_to_att(walleye_detections, rcv)