Parser and plotter for NEXRAD VAD retrievals.
The script downloads the VAD data from either the NEXRAD Radar Product Dissemination page or Google cloud, parses the binary file, and plots the VAD retrieval as a hodograph. It also computes and displays some parameters of interest.
NumPy and Matplotlib are the only requirements to run this script.
python vad.py RADAR_ID [ -m STORM_MOTION ] [ -s SFC_WIND ] [ -t TIME ] [ -f IMG_NAME ]
[ -p LOCAL_PATH ] [ -c CACHE_PATH ]
RADAR_IDis a 4-character radar identifier (e.g. KTLX or KFWS). TDWRs (e.g. TDFW or TORD) also work.STORM_MOTIONis the storm motion vector. It can take one of two form. The first is eitherBRMfor the Bunkers right-mover vector orBLMfor the Bunkers left-mover vector. The second form isDDD/SS, whereDDDis the direction the storm is coming from in degrees, andSSis the storm speed in knots. An example might be 240/35 (from the WSW at 35 kts). If the argument is not specified, the default is to use the Bunkers right-mover vector.SFC_WINDis the surface wind vector. Its form is the same as theDDD/SSform of the storm motion vector. A dashed red line will be drawn on the hodograph from the lowest point in the VWP to the surface wind to indicate the approximate wind profile in that layer.TIMEis the plot time. It takes the form[YYYY-mm-]dd/HHMM, whereYYYYis the 4-digit year,mmis the month,ddis the day,HHis the hour, andMMis the minute. The year and month are optional. If downloading from the Internet, the script will plot the most recent VWP as of this time. If loading from the local disk, it needs to be an exact time.IMG_NAMEis the name of the image the script produces. If not given, it defaults to<RADAR_ID>_vad.png. If you would like a vector image rather than a raster image, give a name with a .pdf file extension.LOCAL_PATHspecifies that, instead of downloading VWP data from the Internet, the script should load the VWP data from this path on the local disk. Data are assumed to have been downloaded from NCDC's NEXRAD archive. The name of the file should not be given; the script will construct the file name using the other information.CACHE_PATHis the path to a local directory in which to cache files downloaded from the Internet. The downloaded files can be read in directly using the -p option.
An example of the output is given below. See the interpretation section for more information.
python vad_json.py RADAR_ID [ -t TIME ] [ -o OUTPUT_PATH ] [ -p LOCAL_PATH ] [ -c CACHE_PATH ]
The options here are largely the same for the image plotting, except that -o can be specified to change where the JSON files are output to.
On Google cloud, all files from all products from a given radar on a given day are archived in the same file. This means that if you pull data from Google cloud, it has to download the entire daily archive, which can be up to a couple hundered MB. To mitigate the impact, if you specify -c, all VWP files from the day you request are cached in that directory. Then, if you want to look at another file from that day, you can use -p to load that file. For example:
# Download all files from 9 May 2016 and cache them in /path/to/cache (also dumps the JSON file for 2105 UTC)
python vad_json.py KTLX -t 2016-05-09/2105 -c /path/to/cache
# Dump the JSON file for 2203 UTC, using the files cached in the previous line
python vad_json.py KTLX -t 2016-05-09/2203 -p /path/to/cache
The file caching also happens with the image plotting, as well, not just JSON files.
A "hodograph" is a graph of wind as a function of height. The u component of the wind is on the x axis and the v component of wind is on the y axis. Area on the hodograph is proportional to helicity, an important parameter in severe convective storm forecasting.
The colors denote different height layers, and follow the Storm Prediction Center's convention for their hodographs: red denotes the 0-3 km layer, light green denotes the 3-6 km layer, dark green denotes the 6-9 km layer, purple denotes the 9-12 km layer, and cyan denotes the layer from 12 km on up. The colored circles are proportional in radius to the RMS error in the VAD retrieval at each level.
When computing the parameters, in the absence of a specified surface wind, the "surface" is taken to be the lowest data point in the VWP, which is often ~100 m AGL.