repository | sattagutils | io home

monitorgonio

Argos Goniometer

The Woods Hole Group (formerly CLS America) rents and sells an antenna and receiver that they call the Argos Goniometer. This machine can pick up and directionalize Argos PTTs and even downloads messages.

We set up our Goniometer to run in hyperterminal mode connected to a laptop on the boat. Basically this spits the Goniometer log out to a text file. There are a couple of different types of text that are displayed in that log but it is mostly comma separated values.

The package

This package is a quick hack to display Goniometer output in a user friendly display using shiny. The Goniometer's screen is tiny, but as mentioned above the hyperterminal mode when connected to a laptop outputs all data to a simple text log file. The shiny app just eavesdrops on this log and uses a key file you load in (csv) to match PTT (hex codes) and display only your platforms of interest. In addition, the program displays the bearing visually on a compass face (circle) and in a table, which is easier to read than the stock software.

inactionimagefile <- "images/inaction.gif"
if(knitr::is_latex_output()) inactionimagefile <- "images/inaction.png"
knitr::include_graphics(inactionimagefile)

Obligatory warnings

This package is still very rough so use it at your own risk. It might crash and then you miss an important PTT.

Quick guide

The package isn't on cran yet so you'll have to install it from the github repo. Either directly or by using devtools. The dependencies are shiny, shinyFiles, and plotrix.

devtools::install_github("williamcioffi/monitorgonio")

You can run monitorgonio from an interactive r session:

monitorgonio::run_monitorgonio()

Or you can automatically generate monitorgonio.bat which will run the shiny app for you. I hope with the right paths. Be careful for some reason on windows '~' is interpreted as documents or the onedrive...

monitorgonio::make_bat_file("monitorgonio.bat")
knitr::include_graphics("images/loaddata.png")

You'll also have to create a ptt key file (CSV) so monitor gonio knows what to listen for. You can get an example template which comes as a dataframe in the package and save it for editing in your favorite editor.

# a template pttkey comes with the package
data(pttkey, package = "monitorgonio")
pttkey

You can also construct one easily in R and save it as a csv.

pttkey <- data.frame(
    PTT = c("111111", "222222"),
    HEX = c("0A1FB2", "D7914E1"), 
    DEPLOYID = c("test1", "test2")
)

# save to file
write.table(pttkey, file = "pttkey.csv", sep = ",", row.names = FALSE)

Note: you don't really need the PTT column which is for the decimal PTT, unless you just want to keep track of it on the screen. What the Goniometer actually receives is the hex.

Testing

You can test monitorgonio a bit even if you don't have a Goniometer connected or a platform handy. To do this you'll need two instances of R open. Either start monitor gonio with the .bat script, or start it with run_monitorgonio() and then open a new instance of R.

In this new instance of R first you'll need to save the pttkey from above. Save it anywhere you like just remember the path. Next we'll need a simulated log file. We'll use a function in a moment to append to the log file as if hits were coming in one by one on the Goniometer, but for now you can just create an empty file:

cat("", file = "testlog")

Now make sure monitorgonio is running and go to the shiny window and select both the log file and the pttkey using the buttons and navigating to where you saved them.

Finally, run the test with:

monitorgonio::simulate_gonio("testlog")

...and you should see hits appearing in the monitorgonio shiny window.

One word of caution about ptts and csvs

If you are opening these csv files in excel and if your hex has an E somewhere in the middle and all the other digits are numbers (not letters) then excel will interpret it as scientific notation. For example 12345E2 will be converted into $12345 \cdot 10^2$ by excel. This is quite annoying and will happen every time you open the file. It'll look something like this:

knitr::include_graphics("images/badhex.png")

The best solution is don't use excel because it is a terrible csv editor. But many folks are most comfortable with editing csvs in excel so in the past I've added a notes column that starts with text so the real hex can be recovered if someone accidentally edits it in excel and saves the result.

knitr::include_graphics("images/savedhex.png")


williamcioffi/monitorgonio documentation built on Nov. 15, 2023, 1:37 p.m.