Skip to content

Commit ef16dbd

Browse files
committed
Initial commit of the OTN animal-from-tag code.
1 parent d49a728 commit ef16dbd

2 files changed

Lines changed: 20 additions & 0 deletions

File tree

R/ato_ani_from_otn.R

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
ato_ani_from_otn <- function(otn_file) {
2+
#Import the file we've got.
3+
otn_data <- load_file(otn_file)
4+
5+
#OTN doesn't have a bespoke animal file so we'll take what we get from the tag file.
6+
ani <- make_ani(
7+
animal = otn_data$ANIMAL_ID,
8+
capture_location = otn_data$CAPTURE_LOCATION,
9+
capture_datetime = as.POSIXct(NA_real_),
10+
capture_lat = otn_data$CAPTURE_LAT,
11+
capture_lon = otn_data$CAPTURE_LON,
12+
release_location = otn_data$RELEASE_LOCATION,
13+
release_datetime = as.POSIXct(otn_data$UTC_RELEASE_DATE_TIME),
14+
release_lat = otn_data$RELEASE_LATITUDE,
15+
release_lon = otn_data$RELEASE_LONGITUDE,
16+
tz = "UTC",
17+
)
18+
}

R/otn_to_ato.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ otn_to_ato <- function(otn_detections, otn_receivers = "", otn_tags = "") {
6868
}
6969

7070
OTN_ATO <- add(OTN_ATO, tag)
71+
72+
7173

7274

7375
return(OTN_ATO)

0 commit comments

Comments
 (0)