A set of tools for NWS weather reporting and radar image compositing and animation. These tools have been tested on Linux and Cygwin but should also work on MacOS (with Homebrew or a similar package manager for dependencies). These scripts utilize services provided by the United States NWS, and can therefore only report weather for locations within the United States.
A shell script that, given latitude and longitude, produces a plain-text weather report from the NWS. It uses the Lynx web browser (Note: Lynx HTTPS support is required) in dump mode to retrieve the content as plain text. Some additional text processing is utilized to trim the top and bottom of the report.
./weather.sh 40.0395 -84.2033
Revision 22 - Sun June 19 2022 (radar.tar.gz, 16K)
A Bash script that given radar ID, number of minutes to depict, and amount of time (in days) after which archived images are deleted ("never" can also be specified), outputs a radar image using the most recent NWS image available and an animation of the specified duration. It uses Lynx and Wget to retrieve the radar images and ImageMagick to produce the composite images and animation. This script has been tested on Linux and Cygwin. Example usage:
./radar.sh ILN 64 .083
In the above example, an animation depicting approximately one hour's radar activity will be produced for radar ID
ILN. Archived images older than two hours (
2 / 24 = .0833) will be deleted.
These variables handle the processing of the image list from the NWS, the processing of the images themselves, etc. Of special note is the
radar_bg variable. Normally, this would be a map of the appropriate area. However, as production of this asset is a currently a manual process, only a placeholder image is provided.
footer_len=1 # Number of lines in footer to cut off image_freq=4 # How often radar images are updated by NWS resize_amt='25%' # Amount to shrink the images by animate_dur=$2 # Duration (in minutes) to depict in animation radar_bg='background.gif' # Background image (e.g. map) to use font_color='white' # Font color to use for radar image date and time delete_older_than=$3 # Delete files older than
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.