Generate Geotiff from Rainbow file with wradlib

Hi,

I’m trying to follow this tutorial in order to get data from a Rainbow (.vol) file and export it to a Geotiff file. However the tutorial refers to RADOLAN dataset, and I’m having difficulties in figuring out how to proceed to do the same with my file.
How exactly should this tutorial be adapted for a Rainbow file?

Thanks in advance,
Danilo

Hi Danilo,

The example you are referring works on cartesian data. Sou you would have to interpolate your polar data to cartesian before.

There is no combined example (cartesian interpolation and output to GIS) so far. It’s on my todo-list, but not as immediate priority. If you are up to it, I’ll gladly assist.

1 Like

UPDATE: First try

In my first attempt I exported the values to a .csv file with their projected coordinates.
This file is loaded into QGIS, then made into a points vector layer, which is converted into raster layers with different resolutions.

Drawbacks:

  1. The raster layer has a equally dimensioned area of value validity (like a square), which does not represent the actual shape of coverage of a radar bin.
  2. A raster layer has fixed resolution, which again does not represent the variable resolution of a radar sweep data (decreasing with range).
  3. Data loss: The value of the pixel comes from a single point inside it, other values are discarded.

To ‘fix’ drawback no. 2, the resolution is lowered until the pixels cover the entire area of the desired region.

This first image show the points vector layer loaded in QGIS.

This one shows the previous layer rasterized to range resolution, the inner points become an uniform layer, but outer points still miss data between them.

This one show the layer rasterized to 10 times the range resolution, the filled area reaches outer as the resolution becomes poorer.

I’ll be trying new methods and keeping the community updated.

UPDATE: Second try

The second method I’m trying is to save an black and white PPI plot without any extra borders or image elements to PNG format, alongside a World File (.pngw), which QGIS can load to georreference the image.

The positive effect is that the plotted image has a good representation of the area that a bin represents.

Unfortunately the PNG seems to be somewhat misaligned when seen under the point layer in QGIS.

The points come from wradlib’s spherical_to_centroids, as described in the First Try Update above.


Red and blue color scale shows the points.


Zoomed in image shows raster (PNG, black and white) under points. Notice that both layers show the same variations on their respective colors.


But looking closer at the bins, the point (centroid) does not lay on the center of the area. Radar is located to the lower right side. Points are always closer to the radar than a pixelated area in any direction.

This misalignment was fixed by subtracting half of the range from the range ndarray when plotting.
The next step is saving the values in png, because python png saving functions only support saving 8 bit integer values, whose range is between 0 and 255. So, rounding the number and adding the minimum value can temporarily solve the issue (if the data is reflectivity, whose range is between -31.5 and ~100 dBZ). Just remember to subtract again when reading.