Wradlib - synthetic CAPPI

Hello everybody,

I’m trying to use wradlibs tutorial in creating a set of CAPPIs with synthetic radar polar volume data (see here: wradlib.vpr.CAPPI — wradlib).

I get the following error, when running this script. I guess it has something to do with gdal/ osgeo:
It is in line 16, when using: wradlib.vpr.volcoords_from_polar:

File ~\anaconda3\envs\radar_venv1\lib\site-packages\wradlib\georef\projection.py:333 in reproject
trans = np.array(ct.TransformPoints(C))

AttributeError: ‘NoneType’ object has no attribute ‘TransformPoints’

I use python 3.9 and tried it with gdal 3.2.3 and gdal 3.4.3.

Thanks for your help

@atmoboran Welcome to openradar discourse.

You probably have to set environment variables GDAL_DATA or PROJ_DATA pointing to the location of the projection database (~\anaconda3\envs\radar_venv1\share\gdal or ~\anaconda3\envs\radar_venv1\share\proj). At least that’s the most likely issue here. Also set PROJ_NETWORK=On to enable automatic loading of transformation data.

There’s also proj-data package available at conda-forge which contains complere proj database.

HTH,
Kai

Thanks Kai!

For me it worked with installing proj-data and setting the environment variables accordingly.
I’m working on Windows, so there are some problems with GDAL.

I attached a screenshot - is this how it’s supposed to look like?

And to everyone who is having a similar problem (working with Windows):
be sure the slashes are correct, when setting the environment variable
(see this discussion for more: Problem with WRADLIB-DATA (google.com))

@atmoboran Glad you got it working.

The image in general looks OK. Is this artificial Data? That striping pattern makes me a bit nervous :grimacing: Can you elaborate a bit on the source data?

I literally just ran the example code from wradlib.vpr.CAPPI — wradlib without changing anything.
I didn’t set ‘PROJ_NETWORK=On’ though, as I didn’t know where to do this.

PS: when copying the whole code with the copy buttom all the ‘>>>’ are copied too, so one needs to copy by hand.

Hi @atmoboran

OMG :joy:, I totally forgot about that example in the docstring :man_facepalming:. Yes, this is how it should look like.

We would need to fix this in the docstring somehow, to tell sphinx to remove the >>> when copying.