Raster Graphics for Radar Data

{*} A task for RasterGraphics

Here is a former class project, done in C many years ago, which is now given as a Python project. It is an exercise in plotting raster graphics of data given in polar coordinates.

Here is some data of reflectivity values in polar coordinates:
KIWA.vol140.dat.gz

Here is a document describing the data:
radardataformat.txt

Here is a rendering of the data from some sort of software package:
crefxv.png

The above 3 files were all provided to me by Chris Calvert, many years ago.

Your browser may automatically "gunzip" anyfile.dat.gz into anyfile.dat, and allow you to save as anyfile.dat. If you save as KIWA.vol140.dat, that is fine, you can skip the manual gunzip command provided below.

If you are curious about the decompression command gunzip, and the compression command gzip, then you may want to visit the gzip home page. But the basic usefullness is rather simple to understand. gzip reversibly compresses files to be smaller, and adds the .gz extension. For common text files, the compression can sometimes be about 20% of the original size. For files of numbers stored in binary format, without repetition or patterns in the numbers, the compression may not be much at all. For a long text file with repeating lines of a single character, the reduction in file size is very substantial.


Your task is contained in: rasterradar.py

rasterradar.py KIWA.vol140.dat

will make two PPM images: Data plotted with theta to the right and r downward and a color legend:

radarimage.png

radarcolors.png

The colors for the dBZ levels were obtained from RAP radar.

Your task (which is defined and initiated within rasterradar.py) is to (1) develop the code that produces the polar-coordinate rendering and (2) use inkscape to combine the PNGs and add the annotation:
ImageAndLegend.png

The second step is an example of the important skill of combining raster graphics with vector graphics.