convert_otn_erddap_to_att: Convert detections, transmitter, receiver, and animal...

View source: R/util-convert_otn_erddap_to_att.r

convert_otn_erddap_to_attR Documentation

Convert detections, transmitter, receiver, and animal metadata to a format that ATT accepts.

Description

Convert glatos_detections and transmitter, receiver, and animal metadata from the OTN ERDDAP to ATT format for use in the Animal Tracking Toolbox (https://github.com/vinayudyawer/ATT).

Usage

convert_otn_erddap_to_att(detectionObj, erdTags, erdRcv, erdAni)

Arguments

detectionObj

a data frame from read_glatos_detections

erdTags

a data frame with tag release data from the OTN ERDDAP

erdRcv

a data frame with receiver station data from the OTN ERDDAP

erdAni

a data frame with animal data from the OTN ERDDAP

Details

This function takes 4 data frames containing detection, and ERDDAP data from the tags, receivers, and animals tables, and transforms them into 3 tibble::tibble objects inside of a list. 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://gitlab.oceantrack.org/GreatLakes/glatos/issues/83 in a comment by Ryan Gosse. The OTN ERDDAP instance is here: https://members.oceantrack.org/erddap/tabledap/index.html but please note that this only contains public data.

Value

a list of 3 tibble::tibbles containing tag dectections, tag metadata, and station metadata, to be ingested by VTrack/ATT

Author(s)

Ryan Gosse

Examples


#--------------------------------------------------
# EXAMPLE #1 - loading from the OTN ERDDAP + vignettes

library(glatos)

#get path to example files from OTN ERDDAP
ani_erd_file <- system.file("extdata", "otn_aat_animals.csv",
                            package = "glatos") 
animals <- read.csv(ani_erd_file) # load the CSVs from ERDDAP

tags_erd_file <- system.file("extdata", "otn_aat_tag_releases.csv",
                            package = "glatos") 
tags <- read.csv(tags_erd_file)

rcv_erd_file <- system.file("extdata", "otn_aat_receivers.csv",
                            package = "glatos") 
stations <- read.csv(rcv_erd_file)

#Remove first row; (blank or metadata about the column) 
animals <- animals[-1,] 
tags <- tags[-1,]
stations <- stations[-1,]

#get blue shark example data
shrk_det_file <- system.file("extdata", "blue_shark_detections.csv",
     package = "glatos")
blue_shark_detections <- read_otn_detections(shrk_det_file) # load shark data

ATTdata <- convert_otn_erddap_to_att(blue_shark_detections, 
                                     tags, stations, animals)

jsta/glatos documentation built on July 11, 2022, 7:01 a.m.