1.1 Detections
objects
The heart of kaltoa
is the Detections
object (see ?Detections
).
Along with detections data for a given receiver, this also holds useful metadata for the receiver’s position and sync-tags.
Below is a typical table of raw detection data we’ll use to build a Detections
object.
## timestamp detect_id type
## 1 2021-05-08T18:00:09.427 62074 PPM
## 2 2021-05-08T18:00:38.772 62042 PPM
## 3 2021-05-08T18:00:48.244 62584 PPM
## 4 2021-05-08T18:01:03.878 PPM_SELF PPM_SELF
## 5 2021-05-08T18:02:21.749 62368 PPM
## 6 2021-05-08T18:05:23.948 62074 PPM
First, we’ll convert our detection ISO dates-time strings into a more handy format.
# Convert times into numeric values
detect_time <- iso2DetectionTime(example$timestamp, tz = "CET")
# Preview detection times
head(detect_time)
## Time zone: CET
## second millisecond
## 1 2021-05-08 18:00:09 427
## 2 2021-05-08 18:00:38 772
## 3 2021-05-08 18:00:48 244
## 4 2021-05-08 18:01:03 878
## 5 2021-05-08 18:02:21 749
## 6 2021-05-08 18:05:23 948
Here, the column titled second
holds POSIX times — the number of seconds since 1970-01-01.
Now we’ll put this into a Detections
object.
detect <- Detections(
detect_times = detect_time,
detect_id = example$detect_id,
x = 481472, y = 6243509, depth = 3,
emit_id = "62041",
name = "1",
type = example$type,
sync_emissions = example$type %in% c("PPM_SELF", "HR_SELF"))
head(detect)
## Telemetry Detections
## Name: 1
## Sync-tag ID: 62041
## Depth: 3
## Coords: (481472 m, 6243509 m)
## Sync tag emissions: 1
## Detections: 5
## First detection on: 2021-05-08 18:00:09
## Last detection on: 2021-05-08 18:05:23
## Time zone: CET
## second millisecond detect_id type sync_emission
## 1 2021-05-08 18:00:09 427 62074 PPM FALSE
## 2 2021-05-08 18:00:38 772 62042 PPM FALSE
## 3 2021-05-08 18:00:48 244 62584 PPM FALSE
## 4 2021-05-08 18:01:03 878 PPM_SELF PPM_SELF TRUE
## 5 2021-05-08 18:02:21 749 62368 PPM FALSE
## 6 2021-05-08 18:05:23 948 62074 PPM FALSE
kaltoa
uses sync-tags to align the receiver clocks in a telemetry array.
That is, stationary tags embedded into the receivers with known emission times.
The argument sync_emissions
tells kaltoa
which emit_id
values should be treated as sync-tag emissions.
We have the supplementary type
column to distinguish between the types of tags detected/emitted when multiple types of tags are used.