I've been using this project for a bit and it is very useful. However, there are some changes that I propose and would love to hear feedback on.
First, these are the commands I use to enter the project:
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
Then, there is an issue with velocity rendering, though reflectivity works fine. I fix it by doing:
in cmd/nexrad-render/main.go
, around line 181
, replace
// if product != "ref" {
// elv = 2 // uhhh, why did i do this again?
// }
label := fmt.Sprintf("%s %f %s VCP:%d %s %s", ar2.VolumeHeader.ICAO, ar2.ElevationScans[2][0].Header.ElevationAngle, strings.ToUpper(product), ar2.RadarStatus.VolumeCoveragePatternNum, ar2.VolumeHeader.FileName(), ar2.VolumeHeader.Date().Format(time.RFC3339))
render(out, ar2.ElevationScans[elv], label)
with
if product == "vel" {
elv = 2 // uhhh, why did i do this again?
}
render(out, ar2.ElevationScans[elv], fmt.Sprintf("%s - %s", ar2.VolumeHeader.ICAO, ar2.VolumeHeader.Date()))
this is the commit.
I can then do
go run . -f KCRP20170825_235733_V06 -s 2048 -p vel
# OR
go build
./nexrad-render -f KCRP20170825_235733_V06 -s 2048 -p vel
which works awesome. The first change I propose is wondering what the issue is with the velocity rendering, and why I have to change the code as detailed above?
My second proposal is providing an option, perhaps another command flag, to render the output as a vector image, e.g. svg
. You already use the draw2d
library with draw2dimg.SaveToPngFile()
, so i figured that using vector graphics would make the time loading the image on the user’s end much quicker. I figured you could do draw2dimg.SaveToSvgFile()
to accomplish this.
My third proposal is porting this project to a web app. This would mean that one could upload a radar file, specify command flags (e.g. -s 2048
and -p vel
), and then it will give you a png
image to download, exactly how it runs on the command line.
My first thought was WebAssembly, but I am unsure how to interact with a CLI application such as this one using that framework. I 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.
I then stumbled upon this where someone managed to do something very similar with PDF processing. The full repo for that article is found here.
I was wondering if it would be possible to make a rudimentary web application out of your program, using either these things that I have listed, or another way you know of. CSS / styling wouldn't be necessary as this would just be, as I said, rudimentary.
I love your program and will continue to use it, but in the meantime I hope you have time to read and consider these suggestions.
Cheers!
Andrew