How to get the -t and -b given a radar name

Lots of WDSS-II algorithms (w2merger, w2pngconvert, etc.) ask for a top-left and bottom-right corner.  Perhaps you are processing single radar data in a script and want to automatically determine what to specify for -t and -b …

Here’s a sequence of UNIX commands that you can use to obtain the -t and -b given a radar name:

TOP=`grep -A 2 $RADAR ~/WDSS2/w2config/misc/radarinfo.xml | head -2 | tail -1 | sed 's/[=\"]/ /g' | awk '{print $3+4,$5-4}'`
BOT=`grep -A 2 $RADAR ~/WDSS2/w2config/misc/radarinfo.xml | head -2 | tail -1 | sed 's/[=\"]/ /g' | awk '{print $3-4,$5+4}'`

Try it with your favorite radar.  I have it in bash syntax, but obviously, you can put this in pretty much any script.

The -4 and +4 at the end indicate that we are going 4 decimal degrees (approximately 400 km) from the radar center. Obviously, you can/should change that depending on your needs.