Activity table and time stamps

I’m new to Motus and trying to troubleshoot an issue collaborators had with some antennas not functioning on some stations. I think I want the “activity” table and to look at the numGPSfix field, but I can’t figure out how to determine the exact time or day when numGPSfix comes back as NA.

I can match the batchID’s to data in other tables to get a start and end date/time for a batch, but I don’t know I can assume an antenna was or was not functioning during the period within a batch.

Is there a way to get a more specific time stamp for each row in the activity table? Is there a way to use the hourBin field with the batchID start or stop time to do this?

Hi! I think you can can back-calculate the UTC timestamp from the hourBin and from that UTC timestamp convert it to local time. If you’re using R, it would be something like:

library(dplyr)
library(lubridate)

t <- tagme(XXX, new = FALSE, update = FALSE)

problems <- tbl(t, "activity") |> 
  # This select is not strictly necessary, only to remove columns you don't need
  select(-contains("run")) |>  
  filter(is.na(numGPSfix)) |> # Your filter of interest
  collect() |>                # Times need to be collected first
  mutate(ts = hourBin * 3600, # Back convert to timestamp (ts)
         time = as_datetime(ts), # Convert to time
         time_local = with_tz(time, tzone = "America/Vancouver") # Convert to local time (replace this with your local time)
  )

problems

Note that the timezone in the last step needs to be one of something from OlsonNames()

Does this help with your problem?

Yup, I wasn’t aware the conversion for hourBin! Thanks!

1 Like