Out, d*mn spot!
The NOAA weather radar images from the National Weather Service have a reflectivity key on the side. To get rid of the ground clutter & other low intensity noise, just remove the colors from the image corresponding to returns below a certain threshold dBZ.Â It sounds like it ought to be simple, but they threw a small monkey wrench into things.
Here are a copy of the key clipped from the large composite map along with a part of the transparent radar-only composite on a checkered background. If everything at or below 5 or 10 dBZ is removed, most of the noise goes away, but the interesting weather remains. However, the composite national image does not consist of the pure colors shown in the key. Areas of the “same” color consist of a smattering of pixels that have almost the same value. It’s easy for your eye to see them as identical, but not quite as simple for a computer when comparing bits.
I entertained the idea of looking at the colors in terms of hue, saturation, and lightness instead of red, green blue. All pixels above a certain brightness and/or saturation could be removed. Those would correspond to white and grey areas, and to the light blue/cyan areas (below 15 dBZ) if the parameters are chosen carefully. Some initial tests looked promising, but then I discovered that the graphics tools I use (ImageMagick and GraphicsMagick) have a method that seems custom-made for this purpose — a method to turn transparent all pixels in an image of a given color, with a fuzz factor. The fuzz factor allows for matching all pixels close to the given color, and that’s just what is needed.
At the right is the same radar-only transparent image from above with all returns of 10 dBZ or less removed, which corresponds to all shades of grey and the lightest two shades of cyan. The interesting weather remains.
And below are the two versions of the radar images superimposed on a Blue Marble image of the contiguous US. There’s no contest as to which looks betterÂ (the right one).
But am I throwing away too much?Â Let’s compareÂ it to a commercial weather site image that has had the noise already removed.Â I like Weather Underground for their forecasts as well as for their radar images and interfaces.Â I’d bet dollars to doughnuts, though, that they don’t have their own nationwide network of doppler weather radar. They and all the others must be reworking the NOAA images that we in the U.S. have already paid for, adding value with their own reprocessing and presentation. To the far right is a Weather Underground radar image from just about the same time as all the other images here.
To the left of that is a section of the NOAA radar composite that roughly corresponds to the same area, overlaid on the Blue Marble, and prior to projection and rescaling.Â The radar information content in both is very close. In fact, I’d say that Weather Underground has been more aggressive than I, and I’d probably be safe tossing the dark blue as well (15 dBZ).
Fortunately I’ve archived most of the original transparent NOAA composites. I’m reprocessing those now and will generate a new animation without those pulsating white blotches by and by.
Update 8-Sept-09: The new video has been processed and is embedded in the May 2009 derecho series article.Â That article contains a link to the original video if you’d like to compare them.
You can find the Perl script here. It will remove the low-dBZ reflections from the images found on the NWS website.Â All the work to make every pixel of a single color transparent is done with a single call to the packaged method, which utilizes the GraphicsMagick library, so using Perl should be almost as fast as using C or another compiled language. The code simply loops through a list of colors to remove, and it writes the resulting image under another filename. You do have to use a format that supports transparencey (GIF or PNG, e.g.) to get the intended result.
Note that the version of ImageMagick or GraphcisMagic being used will affect whether this works as described.Â After a lot of dependency hassles I gave up and finally upgraded my workhorse number cruncher from an older Fedore Core distribution to a recent Kubuntu version.Â The packages for the older Fedora releaseÂ do not do what is needed here, and it was past time to upgrade anyway.Â (I moved from Fedora to Kubuntu, as I have on other systems, to try to avoid these types of problems, benefiting from the longer lifecycle of Ubuntu’s long-term support versions. But don’t try to drag me into Fedora vs. Ubuntu vs. anything else wars!)
Buried in all the links in the text above is a link to the page with the radar images.Â To make it easier to find, here’s the URL: http://radar.weather.gov/Conus/RadarImg/.Â The world files for the various coverages are included, too.