clean_logs {ARUtools} | R Documentation |
Extract log data from BAR-LT log files
Description
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 ( |
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 |
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.
Value
Data frame containing
-
file_name
s andpath
s of the log files -
event
s and theirdate_time
s -
lat
andlon
for "gps" events -
rec_file
,rec_size
andrec_end
for "recording" events (recording start is thedate_time
of the event) -
schedule
information such asschedule_date
,schedule_name
,schedule_lat
,schedule_lon
,schedule_sr
(sunrise), andschedule_ss
(sunset) -
meta
data information such asmeta_serial
andmeta_firmware
Examples
# 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)