2.1 KaltoaClockSync

KaltoaClockSync objects hold correction values that can be used to synchronize receiver clocks within an array. Additionally, it can also hold receiver position corrections.

Below is a plot of our receiver array. Generally, it’s best to use a single receiver as a reference clock. Here, we’ll use the center receiver 62074, as this has good connectivity to all the surrounding ones.

# Show connectivity 
# (number of detections between receiver pairs)
SyncTagConnectivity(exdata_clocksync) |> summary()
##        receive_id
## send_id 62041 62042 62074 62368 62581 62584
##   62041     0   123   114   114   111    52
##   62042   118     0   107    78   106    89
##   62074   117   118     0   110   109   133
##   62368   117    95   110     0   111   131
##   62581   112   114   111   113     0    15
##   62584   110   119   111   113    95     0
# Plot time-varying sync-tag connectivity
plot(SyncTagConnectivity(exdata_clocksync), nint = 20)

We’ll need to specify a data.frame providing the order for the pairwise clock drift corrections, sync_order, and a vector of times to calculate drift corrections for, offset_times.

# Create a data.frame holding the order of paired clock synchronizations
sync_order = data.frame(
  emit =   c("62074", "62074", "62074", "62074", "62368"),
  detect = c("62368", "62581", "62041", "62042", "62584"))
sync_order
##    emit detect
## 1 62074  62368
## 2 62074  62581
## 3 62074  62041
## 4 62074  62042
## 5 62368  62584

The receivers listed column detect will be synchronized to match the clocks in their emit column on the same row. Here, receiver "62074" will be used as a reference for the first four receivers "62581", "62368", "62041", and "62042". After those pairwise synchronizations, receiver "62368" will then be used as a reference to calibrate "62584". Note that the order matters here, and all receivers in your array should be included in your sync_order table as either a reference—column emit—or a clock to be corrected—column detect.

Take your time on setting up the sync_order table. Receivers pairs with poor sync-tag connectivity will result in poor quality drift corrections.

# Make a vector of times to calculate clock drift corrections for.
offset_times <- seq(
  as.POSIXct("2021-05-08 18:00:00", tz = "CET"),
  as.POSIXct("2021-05-09 06:00:00", tz = "CET"), by = 3600)
offset_times
##  [1] "2021-05-08 18:00:00 CEST" "2021-05-08 19:00:00 CEST"
##  [3] "2021-05-08 20:00:00 CEST" "2021-05-08 21:00:00 CEST"
##  [5] "2021-05-08 22:00:00 CEST" "2021-05-08 23:00:00 CEST"
##  [7] "2021-05-09 00:00:00 CEST" "2021-05-09 01:00:00 CEST"
##  [9] "2021-05-09 02:00:00 CEST" "2021-05-09 03:00:00 CEST"
## [11] "2021-05-09 04:00:00 CEST" "2021-05-09 05:00:00 CEST"
## [13] "2021-05-09 06:00:00 CEST"

Next, we’ll create the KaltoaClockSync model. This holds our parameters for clock synchronization.

# Transmission are assumed to travel no farther
# than 500 meters
max_trns_lat <- 500 / 1500

# Initialize model
sync_model <- KaltoaClockSync(
  sync_order = sync_order,
  max_transmission_latency = max_trns_lat,
  clock_times = offset_times,
  detlst = exdata_clocksync)
print(sync_model)
## KaltoaClockSync Object
##  --- Sync Order
## 1: 62074 ⟶ 62368
## 2: 62074 ⟶ 62581
## 3: 62074 ⟶ 62041
## 4: 62074 ⟶ 62042
## 5: 62368 ⟶ 62584
## 
##  --- Parameters
## Max allowable transmission latency: 0.3 s
## Detection error beta: 32.0
## Detection-emission grouping threshold: 0.5 s
## Transmission speed: 1500.0 m s⁻¹
## 
## 13 clock times ranging from 2021-05-08 18:00:00 CEST to 2021-05-09 06:00:00 CEST
## 
##  --- Clock drift ranges
## 62074⟶62368:   0.0000 s -- 0.0000   s
## 62074⟶62581:   0.0000 s -- 0.0000   s
## 62074⟶62041:   0.0000 s -- 0.0000   s
## 62074⟶62042:   0.0000 s -- 0.0000   s
## 62368⟶62584:   0.0000 s -- 0.0000   s
## 
##  --- Clock offsets
## 62041:  0.0000 s
## 62042:  0.0000 s
## 62074:  0.0000 s
## 62368:  0.0000 s
## 62581:  0.0000 s
## 62584:  0.0000 s
## 
##  --- Position offsets
## 62041:  0.0 m, 0.0  m
## 62042:  0.0 m, 0.0  m
## 62074:  0.0 m, 0.0  m
## 62368:  0.0 m, 0.0  m
## 62581:  0.0 m, 0.0  m
## 62584:  0.0 m, 0.0  m

KaltoaClockSync objects have a number of convenience functions that will allow us to check the effects of our corrections on the underlying sync-tag data set. We’ll see examples of these in the following sections.