I have been working with the brilliant Go program go-nexrad. I am able to run this on my computer (M1 MacBook Pro) with some setup:
git clone https://github.com/bwiggs/go-nexrad.git
cd go-nexrad && cd cmd && cd nexrad-render
# these two commands are just to download radar files
aws s3 cp --no-sign-request s3://noaa-nexrad-level2/2017/08/25/KCRP/KCRP20170825_235733_V06 .
aws s3 cp --no-sign-request s3://noaa-nexrad-level2/2022/04/18/KLWX/KLWX20220418_153931_V06 .
go get -u golang.org/x/sys
I can then run a command such as go run . -f KCRP20170825_235733_V06 -s 2048 -p ref to generate a radar.png file in the same directory.
I am aware of WebAssembly being able to compile Go programs to run on a webpage, but I am unsure how to interact with a CLI application such as this one using this framework. I have found several guides online, but they are for simple applications where the program just takes user input and then logs the result to the console.
This program is slightly more complex, as it has to write an entirely new png file.
Does anybody know of a way that I can work with this project in such a way that I can interact with the relevant CLI commands, e.g. specifying a radar file and setting the product via command flags, and have it run on a webpage?
Any advice would be appreciated.