Skip to contents

Process BAR-LT log files into a data frame reflecting metadata, schedule information, and events. Events are time-stamped logs of either GPS fixes (lat and lon) or recordings (rec_file, rec_size, rec_end).

Usage

clean_logs(
  log_files,
  return = "all",
  pattern_sr = "(SR)",
  pattern_ss = "(SS)",
  progress = TRUE
)

Arguments

log_files

Character vector of log files to process.

return

Character. What kind of data to return, GPS fixes ("gps"), recording events ("recordings") or "all" (default).

pattern_sr

Character. Pattern to match the sunrise schedule in the log files.

pattern_ss

Character. Pattern to match the sunset schedule in the log files.

progress

Logical. Whether to use purrr::map() progress bars (default TRUE).

Value

Data frame containing

  • file_names and paths of the log files

  • events and their date_times

  • lat and lon for "gps" events

  • rec_file, rec_size and rec_end for "recording" events (recording start is the date_time of the event)

  • schedule information such as schedule_date, schedule_name, schedule_lat, schedule_lon, schedule_sr (sunrise), and schedule_ss (sunset)

  • metadata information such as meta_serial and meta_firmware

Details

Note that log files can have glitches. If there is no start time for a recording (generally when there is a problem and no recording is made), the date_time value for that recording will be the same as the rec_end time.

Because the BAR-LT units adjust their time according to the GPS locations, all times are in "local" to that area.

Examples

if (FALSE) { # dir.exists("my_project_folder")
# Replace "my_project_folder" with your directory containing your recordings and logfiles
log_files <- fs::dir_ls("my_project_folder", recurse = TRUE, glob = "*logfile*")
log_files
logs <- clean_logs(log_files)

log_files <- "../ARUtools - Extra/aru_log_files/P028/1A_BARLT10962/logfile_00010962_SD1.txt"

clean_logs(log_files)
clean_logs(log_files, return = "gps")
clean_logs(log_files, return = "recordings")

log_files <- fs::dir_ls("../ARUtools - Extra/aru_log_files/", recurse = TRUE, glob = "*logfile*")

l <- clean_logs(log_files)
}