Skip to content

Commit

Permalink
update to vdat version 9.13.2
Browse files Browse the repository at this point in the history
  • Loading branch information
mhpob committed Jul 8, 2024
1 parent 98d7034 commit d96a670
Show file tree
Hide file tree
Showing 8 changed files with 3,754 additions and 3,812 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: rvdat
Title: Lightweight Access to 'VDAT' Shell Commands
Version: 0.0.0.9100
Version: 0.0.1.900
Authors@R: c(
person("Michael", "O'Brien", , "[email protected]", role = c("aut", "cre"),
comment = c(ORCID = "0000-0003-1420-6395"))
Expand Down
2 changes: 1 addition & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
output: github_document
---

<!-- README.md is generated from README.Rmd. Please edit that file -->
<!-- README.md is generated from README.Rmd. Please edit that file -->

```{r, include = FALSE}
knitr::opts_chunk$set(
Expand Down
117 changes: 27 additions & 90 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

<!-- README.md is generated from README.Rmd. Please edit that file -->
<!-- README.md is generated from README.Rmd. Please edit that file -->

# rvdat

Expand Down Expand Up @@ -136,18 +136,18 @@ What version?

``` r
vdat_version()
#> vdat-7.0.0-20231107-14c992-release
#> vdat-9.13.2-20240607-7a2e9d-release
```

Convert a VRL to CSV:

``` r
## vdat_to_csv("SOME-VDAT-FILE")
#> ✔ File converted:
#> C:\Users\darpa2\AppData\Local\Temp\RtmpEDUiDu/readme_files/HR2-180 461396
#> C:\Users\darpa2\AppData\Local\Temp\RtmpINUXfp/readme_files/HR2-180 461396
#> 2021-04-20 173145.vdat
#> ℹ File saved in:
#> C:\Users\darpa2\AppData\Local\Temp\RtmpEDUiDu/readme_files/HR2-180 461396
#> C:\Users\darpa2\AppData\Local\Temp\RtmpINUXfp/readme_files/HR2-180 461396
#> 2021-04-20 173145.csv
```

Expand All @@ -156,17 +156,17 @@ Convert a VRL to a folder of CSVs split by data type:
``` r
## vdat_to_folder("SOME-VDAT-FILE")
#> ✔ File converted:
#> C:\Users\darpa2\AppData\Local\Temp\RtmpEDUiDu/readme_files/HR2-180 461396
#> C:\Users\darpa2\AppData\Local\Temp\RtmpINUXfp/readme_files/HR2-180 461396
#> 2021-04-20 173145.vdat
#> ℹ Files saved in:
#> C:\Users\darpa2\AppData\Local\Temp\RtmpEDUiDu/readme_files/HR2-180 461396
#> C:\Users\darpa2\AppData\Local\Temp\RtmpINUXfp/readme_files/HR2-180 461396
#> 2021-04-20 173145.csv-fathom-split
## list.files("SOME-VDAT-FILE.csv-fathom-split")
#> [1] "ATTITUDE.csv" "BATTERY.csv" "CFG_CHANNEL.csv"
#> [4] "CFG_TRANSMITTER.csv" "CLOCK_SET.csv" "DATA_SOURCE_FILE.csv"
#> [7] "DET.csv" "DET_FILTER.csv" "DIAG_HR2.csv"
#> [10] "EVENT.csv" "EVENT_INIT.csv" "EVENT_OFFLOAD.csv"
#> [13] "TEMP.csv"
#> [4] "CFG_TRANSMITTER.csv" "CLOCK_REF.csv" "CLOCK_SET.csv"
#> [7] "DATA_SOURCE_FILE.csv" "DET.csv" "DET_FILTER.csv"
#> [10] "DIAG_HR2.csv" "EVENT.csv" "EVENT_INIT.csv"
#> [13] "EVENT_OFFLOAD.csv" "TEMP.csv"
```

Check out the file metadata:
Expand Down Expand Up @@ -450,11 +450,10 @@ vdat_template(format = "csv.fathom")
#> [4] "Time Correction (s)" "Model" "Serial Number"
#> [7] "Memory Remaining (%)" "Relative Humidity (%)" "RTC Time"
#>
#> $NOISE_DESC
#> [1] "Device Time (UTC)" "Time" "Time Offset (h)"
#> [4] "Time Correction (s)" "Model" "Serial Number"
#> [7] "Channel 1 noise (TBD)" "Channel 2 noise (TBD)" "Channel 3 noise (TBD)"
#> [10] "Channel 4 noise (TBD)"
#> $HEALTH_NEXTRAK_DESC
#> [1] "Device Time (UTC)" "Time" "Time Offset (h)"
#> [4] "Time Correction (s)" "Model" "Serial Number"
#> [7] "Memory Remaining (%)"
#>
#> $NOISE_STATS_VR2AR_DESC
#> [1] "Device Time (UTC)" "Time"
Expand Down Expand Up @@ -493,88 +492,26 @@ vdat_template(format = "csv.fathom")
#> [7] "Ambient Min (deg C)" "Ambient Max (deg C)"
#> [9] "Ambient Mean (deg C)" "Sample Count"
#> [11] "Accumulation Period (s)"
#>
#> $XPND_EVENT_DESC
#> [1] "Device Time (UTC)" "Time"
#> [3] "Time Offset (h)" "Time Correction (s)"
#> [5] "Model" "Serial Number"
#> [7] "Type" "Subtype"
#> [9] "Description" "Values"
#> [11] "Responder Model" "Responder Serial Number"
#> [13] "Responder Range (m)" "Transmit Power (dB)"
#> [15] "Receive Signal (dB)" "Receive Gain (dB)"
#> [17] "Latitude" "Longitude"
#> [19] "GPS HDOP"
```

Call VDAT using standard flags:

``` r
vdat_call("--help")
#> VDAT File Tool
#> Usage:
#> vdat [OPTION...] [COMMAND [ARG]...]...
#>
#> Common options:
#> --format FORMAT Output file format (e.g. csv.fathom, csv.fathom.split,
#> json.rxlog)
#> --output PATH Output file or directory path
#>
#> Conversion Options options:
#> --timec OPTION Enable time correction (e.g. --timec=default)
#> --detection-filter FILTER
#> Detection filtering algorithm ???
#> --tagdb FILEPATH Path of local tag database to be used for
#> sensor value conversion.
#> --offset-hours HOURS Offset times by a number of hours. Typically
#> used to change time zone.
#> --segment-hours HOURS Maximum data timespan (in hours) to include
#> in each output file
#>
#> General options:
#> -h, --help Print application help (and exit)
#> -v, --version Print application version (and exit)
#> --app-id Print application identity (and exit)
#> --debug Enable debug mode
#> -p, --progress Output realtime progress to the console
#>
#> Logging options:
#> --log [=PATH(=C:\Users\darpa2\AppData\Local\Innovasea\VRPC\vdat)]
#> Enable file logging. Explicit path is
#> optional.
#> --log-level LEVEL Set filter threshold for file logging [0
#> (most verbose), 1000 (least verbose)]
#> --trace Send all logging to console (no filtering)
#> --trace-debug Send logging to console with debug-level
#> filtering (200)
#> --trace-info Send logging to console with info-level
#> filtering (300)
#>
#> Commands:
#> convert Convert file to the given file format
#> . Usage: vdat convert --format=<FORMAT> <INPUT_FILEPATH>
#> .
#> . Optional: --output=<FILE_OR_DIRECTORY_PATH>
#> . --timec=default
#> . --detection-filter=<FILTER>
#> . --tagdb=<FILEPATH>
#> . --offset-hours=<HOURS>
#> . --segment-hours=<HOURS>
#> .
#> . Example: vdat convert --format=csv.fathom <INPUT_FILEPATH>
#> . vdat convert --format=json.rxlog <INPUT_FILEPATH>
#>
#> inspect Describe the content of an existing file
#> . Usage: vdat inspect <INPUT_FILEPATH>
#>
#> template Generate template for a given file format
#> . Usage: vdat template --format=<FORMAT>
#> .
#> . Optional: --output=<OUTPUT_FILEPATH>
#> .
#> . Example: vdat template --format=vfwp
#>
#> Usage: C:\PROGRA~1\INNOVA~1\Fathom\vdat.exe [OPTIONS] [SUBCOMMAND]
#>
#> Options:
#> -h,--help Show help and summary of commands, or detailed
#> help for selected command (and exit)
#> --help-all Show help for all commands (and exit)
#> -v,--version Print application version (and exit)
#> --app-id Print application identity (and exit)
#>
#>
#> Subcommands:
#> convert Convert file to the given file format
#> inspect Describe the content of an existing file
#> template Generate template for a given file format
```

## Development notes
Expand Down
62 changes: 24 additions & 38 deletions vignettes/how-to-use-rvdat.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ vignette: >

This vignette is a working draft. There will be lots of changes as `rvdat` gets fleshed out, so please check back often!

The most recent changes were made on 2024-01-10.
The most recent changes were made on 2024-07-08.

## Getting started

Expand Down Expand Up @@ -86,20 +86,13 @@ inspect_df <- vdat_inspect(
#>

head(inspect_df)
#> variable
#> 1 File
#> 2 Original
#> 3 Container
#> 4 Created
#> 5 Data UUID
#> 6 Rx Model
#> value
#> 1 VR2AR_546310_20190613_1.vrl
#> 2 VR2AR_546310_20190613_1.vrl
#> 3 VR2AR VRL file (com.vemco.file.vrl.0207.ff02.ff02/5.0.1)
#> 4 2019-06-13T13:30:54
#> 5 ffee6ee7-450a-db42-b54c-334b672fddf5
#> 6 VR2AR-69
#> variable value
#> 1 File VR2AR_546310_20190613_1.vrl
#> 2 Original VR2AR_546310_20190613_1.vrl
#> 3 Container VR2AR VRL file (com.vemco.file.vrl.0207.ff02.ff02/5.0.1)
#> 4 Created 2019-06-13T13:30:54
#> 5 Data UUID ffee6ee7-450a-db42-b54c-334b672fddf5
#> 6 Rx Model VR2AR-69
#> section
#> 1 VRL
#> 2 VRL
Expand All @@ -120,9 +113,9 @@ vdat_to_csv(
outdir = td
)
#> ✔ File converted:
#> C:\Users\darpa2\AppData\Local\Temp\Rtmp42s2YZ/vignette/VR2AR_546310_20190613_1.vrl
#> C:\Users\darpa2\AppData\Local\Temp\RtmpuIFd1a/vignette/VR2AR_546310_20190613_1.vrl
#> ℹ File saved in:
#> C:\Users\darpa2\AppData\Local\Temp\Rtmp42s2YZ/vignette/VR2AR_546310_20190613_1.csv
#> C:\Users\darpa2\AppData\Local\Temp\RtmpuIFd1a/vignette/VR2AR_546310_20190613_1.csv

list.files(td, pattern = "VR2AR")
#> [1] "VR2AR_546310_20190613_1.csv" "VR2AR_546310_20190613_1.vrl"
Expand All @@ -136,14 +129,14 @@ vdat_to_csv(
outdir = td
)
#> ✔ File converted:
#> C:\Users\darpa2\AppData\Local\Temp\Rtmp42s2YZ/vignette/VR2AR_546310_20190613_1.vrl
#> C:\Users\darpa2\AppData\Local\Temp\RtmpuIFd1a/vignette/VR2AR_546310_20190613_1.vrl
#> ℹ File saved in:
#> C:\Users\darpa2\AppData\Local\Temp\Rtmp42s2YZ/vignette/VR2AR_546310_20190613_1[20240110-11-00-35-xxxxxx].csv
#> C:\Users\darpa2\AppData\Local\Temp\RtmpuIFd1a/vignette/VR2AR_546310_20190613_1[20240708-12-50-27-xxxxxx].csv

list.files(td, pattern = "VR2AR")
#> [1] "VR2AR_546310_20190613_1.csv"
#> [2] "VR2AR_546310_20190613_1.vrl"
#> [3] "VR2AR_546310_20190613_1[20240110-11-00-35-794936].csv"
#> [3] "VR2AR_546310_20190613_1[20240708-12-50-28-002297].csv"
```
## Converting a VDAT file to a CSV with time correction

Expand All @@ -157,9 +150,9 @@ vdat_to_csv(
time_corrected = TRUE
)
#> ✔ File converted:
#> C:\Users\darpa2\AppData\Local\Temp\Rtmp42s2YZ/vignette/VR2AR_546310_20190613_1.vrl
#> C:\Users\darpa2\AppData\Local\Temp\RtmpuIFd1a/vignette/VR2AR_546310_20190613_1.vrl
#> ℹ File saved in:
#> C:\Users\darpa2\AppData\Local\Temp\Rtmp42s2YZ/vignette/VR2AR_546310_20190613_1[20240110-11-00-36-xxxxxx].csv
#> C:\Users\darpa2\AppData\Local\Temp\RtmpuIFd1a/vignette/VR2AR_546310_20190613_1[20240708-12-50-28-xxxxxx].csv
```

A new column is added with time corrected down to the microsecond.
Expand Down Expand Up @@ -192,9 +185,9 @@ vdat_to_folder(
outdir = td
)
#> ✔ File converted:
#> C:\Users\darpa2\AppData\Local\Temp\Rtmp42s2YZ/vignette/VR2AR_546310_20190613_1.vrl
#> C:\Users\darpa2\AppData\Local\Temp\RtmpuIFd1a/vignette/VR2AR_546310_20190613_1.vrl
#> ℹ Files saved in:
#> C:\Users\darpa2\AppData\Local\Temp\Rtmp42s2YZ/vignette/VR2AR_546310_20190613_1.csv-fathom-split
#> C:\Users\darpa2\AppData\Local\Temp\RtmpuIFd1a/vignette/VR2AR_546310_20190613_1.csv-fathom-split

list.dirs(td, full.names = F, recursive = F)
#> [1] "VR2AR_546310_20190613_1.csv-fathom-split"
Expand Down Expand Up @@ -273,20 +266,13 @@ hr_output <- vdat_inspect(file.path(td, "HR2-180 461396 2021-04-20 173145.vdat")
#>
#>
head(hr_output)
#> variable
#> 1 File
#> 2 Original
#> 3 Container
#> 4 Content
#> 5 Created
#> 6 File UUID
#> value
#> 1 HR2-180 461396 2021-04-20 173145.vdat
#> 2 HR2-180 461396 2021-04-20 173145.vdat
#> 3 Vemco Data File (com.vemco.file.vdat/1.0.0)
#> 4 HR2 Receiver Data Pack (com.vemco.file.vrdp.vrhr2/1.0.0)
#> 5 2021-04-20T17:31:45
#> 6 f1a18604-46ea-4985-b57c-24809d37ad46
#> variable value
#> 1 File HR2-180 461396 2021-04-20 173145.vdat
#> 2 Original HR2-180 461396 2021-04-20 173145.vdat
#> 3 Container Vemco Data File (com.vemco.file.vdat/1.0.0)
#> 4 Content HR2 Receiver Data Pack (com.vemco.file.vrdp.vrhr2/1.0.0)
#> 5 Created 2021-04-20T17:31:45
#> 6 File UUID f1a18604-46ea-4985-b57c-24809d37ad46
#> section
#> 1 VDAT
#> 2 VDAT
Expand Down
Loading

0 comments on commit d96a670

Please sign in to comment.