convertLotekCDMAFile: Convert Lotek CDMA log to csv

View source: R/helper.R

convertLotekCDMAFileR Documentation

Convert Lotek CDMA log to csv

Description

Lotek CDMA logs are exported in TXT, and contain several chunks of of information. Importantly, the detections may be saved with a GMT offset, as opposed to the more common UTC standard. Additionally, the date format isn't the standard yyyy-mm-dd.

Usage

convertLotekCDMAFile(file, date_format = "%m/%d/%y")

Arguments

file

the file name.

date_format

the format used by the computer that generated the file

Details

This function extracts the detections from the CDMA file, converts the dates to yyyy-mm-dd, binds the time to the date and resets it to UTC, and ultimately converts the dataframe into the standard format accepted by actel.

Value

A data frame of standardized detections from the input file.

Examples

# create a dummy detections file to read
dummy_file <- tempfile()
sink(dummy_file)
cat(
"WHS FSK Receiver Data File

Receiver Configuration: 
Working Frequency:  76 KHz
Bit Rate:           2400 bps
Code Type:          FSK
Serial Number:      WHS3K-1234567
Node ID:            10000

Receiver Settings:
GMT Correction:     00:00

Decoded Tag Data:
Date      Time             TOA       Tag ID    Type     Value     Power
=======================================================================
04/09/24  22:50:03     0.43875        37910       P       9.1        12
08/21/24  12:45:18     0.99646        55606       M         0         1
08/23/24  15:01:04     0.76042        55778       P       0.0         2

Receiver Sensor Messages:
Date      Time      Sensor   Temp     Press   Battery  Tilt-X  Tilt-Y  Tilt-Z
=============================================================================
04/11/24  21:44:00  T / P    1534         0                                  

Receiver Setup Messages:
Date      Time      Type                    Details                                                     
=============================================================================
08/22/24  18:50:11  Change Logging Mode     New Mode: SETUP
")
sink()

# now read it
x <- convertLotekCDMAFile(dummy_file)

# the dummy file will be deleted automatically once you close this R session.


hugomflavio/actel documentation built on Oct. 16, 2024, 6:19 p.m.