camrinbraun / tags2etuff

An R package for converting the hugely variable formats of animal tag data to a flat file format called eTUFF
Other
2 stars 2 forks source link

Add lotek archival #17

Closed camrinbraun closed 3 years ago

camrinbraun commented 3 years ago

This PR adds functionality for Lotek archival tags. It leverages several helper functions (such as read_lotek()) and can be used just like any other tag format:

meta <- read.table('your_metadata_sheet.csv')
data_dir <- 'where_your_data_lives'
etuff_file <- paste(data_dir, meta$instrument_name[i], '_eTUFF.txt', sep='')

meta$person_qc[i] <- 'Camrin Braun'
meta$found_problem[i] <- 'no'
meta$waypoints_source[i] <- 'Lotek raw light'

## check the meta hdr
build_meta_head(meta_row = meta[i,], write_hdr = F)

## we write lotek archival direct in etuff conversion to save time but this isn't strictly necessary, just faster
etuff <- tag_to_etuff(data_dir, meta[i,],
                        write_direct = TRUE,
                        etuff_file = etuff_file)

## generate and write out QC plots to check it
g <- qc_archival_etuff(etuff, meta_row = meta[i,], writePNG = T, map = T)

Output plots look like: 172419_2003_A2082-psat_qc