CAPPI from NetCDF (Convention: Cf/Radial)

110 views
Skip to first unread message

Elton Robaina

unread,
Jan 23, 2022, 9:05:50 AM1/23/22
to wradlib-users
Hello my friends! 

My name is Elton Robaina, master's degree student Brazil. I'm a radar enthusiast and I've been studying the wradlib library to help people face catastrophic events. And I would like your help to better understand the fantastic tool.
I've been researching several topics here in the group and also on github, how to plot a CAPPI from netCDF data? But still can't do it.

* In a topic 13/06/2021 (Issue with wrl.georef.georeference_dataset function, and CAPPI from netCDF)

Mr. Kai suggests a solution to Mr Syed. I tried to reproduce Kai's solution, but the following error is showing:

""" Unable to allocate 4.13 TiB for an array with shape (1260000, 900000) and data type float32 """

I would like to count on your help to find out where I am going wrong.

I will attach the data and the notebook:  

Kai Muehlbauer

unread,
Jan 24, 2022, 2:11:44 AM1/24/22
to wradli...@googlegroups.com
Hello Elton,

thanks for introducing yourself. Welcome to the wradlib community.

Thanks for providing the dataset, otherwise this would have been
difficult to sort out.

Unfortunately I've bad news for you, the data cannot be imported with
the current CfRadial1-reader in wradlib. Somehow it is missing the
ability to read volumes with variable number of gates (as your files
are). Those have a different internal layout.

If someone of the community is longing for an adventure, Pull Requests
to introduce this are very welcome. I will have a look into this myself,
when I find the time.

Best,
Kai




Am 23.01.22 um 15:05 schrieb Elton Robaina:
> --
> You received this message because you are subscribed to the Google
> Groups "wradlib-users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to wradlib-user...@googlegroups.com
> <mailto:wradlib-user...@googlegroups.com>.
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/wradlib-users/cd6439f4-2bc9-4d10-be9d-6ef35c4fd04bn%40googlegroups.com
> <https://groups.google.com/d/msgid/wradlib-users/cd6439f4-2bc9-4d10-be9d-6ef35c4fd04bn%40googlegroups.com?utm_medium=email&utm_source=footer>.

--
Kai Muehlbauer
Institute of Geosciences, Meteorology Section, University of Bonn
Auf dem Huegel 20 | +49 228 739083
D-53121 Bonn | kai.mue...@uni-bonn.de

Kai Muehlbauer

unread,
Jan 24, 2022, 4:14:58 AM1/24/22
to wradli...@googlegroups.com
Hi Elton,

to get you going, I've added the needed loading mechanism to your notebook.

With this you should be able to work with data with variable number of
gates. Please check if the radar sweep representation plot is correct.
There might be issues with stacking/unstacking so that the moment arrays
might not be correct. It would be great, if you could confirm, that the
procedure actually works correct.

If anyone is interested to move this code into wradlib, please go ahead.

This is the function which need to be fixed:

https://github.com/wradlib/wradlib/blob/29eb09806a348cf0ab0f9eb439765c926a5e63ac/wradlib/io/xarray.py#L1489-L1548

Best,
Kai




Am 24.01.22 um 08:11 schrieb Kai Muehlbauer:
CAPPI_test.ipynb
cappi.png

Syed Hamid Ali

unread,
Jan 24, 2022, 4:33:13 AM1/24/22
to wradli...@googlegroups.com
I also tried but mine is a little different,
image.png

To unsubscribe from this group and stop receiving emails from it, send an email to wradlib-user...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/wradlib-users/16520cbd-1dc9-839a-cc49-599279cd2909%40uni-bonn.de.


--
Syed Hamid Ali

M. Tech Atmospheric Science,

Department of Atmospheric & Space Science,

Savitribai Phule Pune University &

Indian Institute of Tropical Meteorology,

Pune, India.

Mobile : +91 9622222937

GitHub | Google Scholar | Twitter | Linkedin | Website


Syed Hamid Ali

unread,
Jan 24, 2022, 4:36:26 AM1/24/22
to wradli...@googlegroups.com
Hello Kai and Welcome Robin,


Best,
Syed Hamid

To unsubscribe from this group and stop receiving emails from it, send an email to wradlib-user...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/wradlib-users/b13671e9-3e33-fa93-b395-494d3603d9e8%40uni-bonn.de.

Kai Muehlbauer

unread,
Jan 24, 2022, 4:48:16 AM1/24/22
to wradli...@googlegroups.com
Hi Syed, Elton,

here is mine for comparison. It looks like the reading part itself is
OK. At least the two ppi plots look similar. I've used uncorrected
reflectivity in my notebook.

https://gist.github.com/kmuehlbauer/594c8eded5db0896ff911a64a061a2e2

I wonder why in my representation the reflectivities go up to 20km.
Might be an interpolation artefact.

Bets,
Kai



Am 24.01.22 um 10:36 schrieb Syed Hamid Ali:
> <mailto:wradlib-users%2Bunsu...@googlegroups.com>
> > <mailto:wradlib-user...@googlegroups.com
> <mailto:wradlib-users%2Bunsu...@googlegroups.com>>.
> <https://groups.google.com/d/msgid/wradlib-users/cd6439f4-2bc9-4d10-be9d-6ef35c4fd04bn%40googlegroups.com?utm_medium=email&utm_source=footer
> <https://groups.google.com/d/msgid/wradlib-users/cd6439f4-2bc9-4d10-be9d-6ef35c4fd04bn%40googlegroups.com?utm_medium=email&utm_source=footer>>.
>
> --
> Kai Muehlbauer
> Institute of Geosciences, Meteorology Section, University of Bonn
> Auf dem Huegel 20       | +49 228 739083
> D-53121 Bonn            | kai.mue...@uni-bonn.de
> <mailto:kai.mue...@uni-bonn.de>
>
> --
> You received this message because you are subscribed to the Google
> Groups "wradlib-users" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to wradlib-user...@googlegroups.com
> <mailto:wradlib-users%2Bunsu...@googlegroups.com>.
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/wradlib-users/b13671e9-3e33-fa93-b395-494d3603d9e8%40uni-bonn.de
> <https://groups.google.com/d/msgid/wradlib-users/b13671e9-3e33-fa93-b395-494d3603d9e8%40uni-bonn.de>.
>
>
>
> --
> Syed Hamid Ali
>
> /M. Tech Atmospheric Science,/
>
> Department of Atmospheric & Space Science,
>
> Savitribai Phule Pune University &
>
> Indian Institute of Tropical Meteorology,
>
> Pune, India.
>
> Mobile : +91 9622222937
>
> GitHub <https://www.github.com/syedhamidali> | Google Scholar
> <https://scholar.google.com/citations?user=f1DO2GEAAAAJ&hl=en> | Twitter
> <https://www.twitter.com/hamidrixvi> | Linkedin
> <https://www.linkedin.com/in/rizvihamid> | Website <https://shuhul.com>
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "wradlib-users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to wradlib-user...@googlegroups.com
> <mailto:wradlib-user...@googlegroups.com>.
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/wradlib-users/CADqG3xBRHtcNTh4isr%3DdyQSMnvU24kNZukeMq_9O512bHxgi-g%40mail.gmail.com
> <https://groups.google.com/d/msgid/wradlib-users/CADqG3xBRHtcNTh4isr%3DdyQSMnvU24kNZukeMq_9O512bHxgi-g%40mail.gmail.com?utm_medium=email&utm_source=footer>.

Syed Hamid Ali

unread,
Jan 24, 2022, 4:58:29 AM1/24/22
to wradli...@googlegroups.com
I used Py-ART for gridding, you are right, it could be an interpolation artifact, but in my plot, I forgot to change xlim and ylim which is 250 km while it should have been 150,


To unsubscribe from this group and stop receiving emails from it, send an email to wradlib-user...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/wradlib-users/0831e896-6cef-8e62-03a1-3e2698cd23df%40uni-bonn.de.


--
Syed Hamid Ali

M. Tech Atmospheric Science,

Department of Atmospheric & Space Science,

Savitribai Phule Pune University &

Indian Institute of Tropical Meteorology,

Pune, India.

Mobile : +91 9622222937

Kai Muehlbauer

unread,
Jan 24, 2022, 5:09:20 AM1/24/22
to wradli...@googlegroups.com
Yeah, it's an interpolation artifact.

We need to set

minelev=vol.root.sweep_fixed_angle.min().values,
maxelev=vol.root.sweep_fixed_angle.max().values,

in the call to CAPPI. This plots only between the minimum elevation and
maximum elevation, without artifacts from nearest neighbor ipol.

HTH,
Kai

Am 24.01.22 um 10:58 schrieb Syed Hamid Ali:
> I used Py-ART for gridding, you are right, it could be an interpolation
> artifact, but in my plot, I forgot to change xlim and ylim which is 250
> km while it should have been 150,
>
> Dear Elton you can find simple approach here
> https://github.com/syedhamidali/CAPPI-NETCDF/blob/main/simple_cappi.ipynb <https://github.com/syedhamidali/CAPPI-NETCDF/blob/main/simple_cappi.ipynb>
>
> On Mon, Jan 24, 2022 at 3:18 PM Kai Muehlbauer
> <kai.mue...@uni-bonn.de <mailto:kai.mue...@uni-bonn.de>> wrote:
>
> Hi Syed, Elton,
>
> here is mine for comparison. It looks like the reading part itself is
> OK. At least the two ppi plots look similar. I've used uncorrected
> reflectivity in my notebook.
>
> https://gist.github.com/kmuehlbauer/594c8eded5db0896ff911a64a061a2e2
> <https://gist.github.com/kmuehlbauer/594c8eded5db0896ff911a64a061a2e2>
>
> I wonder why in my representation the reflectivities go up to 20km.
> Might be an interpolation artefact.
>
> Bets,
> Kai
>
>
>
> Am 24.01.22 um 10:36 schrieb Syed Hamid Ali:
> > Hello Kai and Welcome Robin,
> >
> > You can find the attachment of the CAPPI plot
> > here
> https://github.com/syedhamidali/CAPPI-NETCDF/blob/main/CAPPI_test%20(1).ipynb
> <https://github.com/syedhamidali/CAPPI-NETCDF/blob/main/CAPPI_test%20(1).ipynb>
>
> >
> <https://github.com/syedhamidali/CAPPI-NETCDF/blob/main/CAPPI_test%20(1).ipynb
> <https://github.com/syedhamidali/CAPPI-NETCDF/blob/main/CAPPI_test%20(1).ipynb>>
> >
> > Best,
> > Syed Hamid
> >
> > On Mon, Jan 24, 2022 at 12:41 PM Kai Muehlbauer
> > <kai.mue...@uni-bonn.de <mailto:kai.mue...@uni-bonn.de>
> <mailto:kai.mue...@uni-bonn.de
> >     <mailto:wradlib-users%2Bunsu...@googlegroups.com
> <mailto:wradlib-users%252Buns...@googlegroups.com>>
> >      > <mailto:wradlib-user...@googlegroups.com
> <mailto:wradlib-users%2Bunsu...@googlegroups.com>
> >     <mailto:wradlib-users%2Bunsu...@googlegroups.com
> <mailto:wradlib-users%252Buns...@googlegroups.com>>>.
> >     <mailto:kai.mue...@uni-bonn.de
> <mailto:kai.mue...@uni-bonn.de>>
> >
> >     --
> >     You received this message because you are subscribed to the
> Google
> >     Groups "wradlib-users" group.
> >     To unsubscribe from this group and stop receiving emails from it,
> >     send an email to wradlib-user...@googlegroups.com
> <mailto:wradlib-users%2Bunsu...@googlegroups.com>
> >     <mailto:wradlib-users%2Bunsu...@googlegroups.com
> <mailto:wradlib-users%252Buns...@googlegroups.com>>.
> <https://shuhul.com <https://shuhul.com>>
> >
> >
> > --
> > You received this message because you are subscribed to the Google
> > Groups "wradlib-users" group.
> > To unsubscribe from this group and stop receiving emails from it,
> send
> > an email to wradlib-user...@googlegroups.com
> <mailto:wradlib-users%2Bunsu...@googlegroups.com>
> > <mailto:wradlib-user...@googlegroups.com
> <mailto:wradlib-users%2Bunsu...@googlegroups.com>>.
> > To view this discussion on the web, visit
> >
> https://groups.google.com/d/msgid/wradlib-users/CADqG3xBRHtcNTh4isr%3DdyQSMnvU24kNZukeMq_9O512bHxgi-g%40mail.gmail.com
> <https://groups.google.com/d/msgid/wradlib-users/CADqG3xBRHtcNTh4isr%3DdyQSMnvU24kNZukeMq_9O512bHxgi-g%40mail.gmail.com>
>
> >
> <https://groups.google.com/d/msgid/wradlib-users/CADqG3xBRHtcNTh4isr%3DdyQSMnvU24kNZukeMq_9O512bHxgi-g%40mail.gmail.com?utm_medium=email&utm_source=footer
> <https://groups.google.com/d/msgid/wradlib-users/CADqG3xBRHtcNTh4isr%3DdyQSMnvU24kNZukeMq_9O512bHxgi-g%40mail.gmail.com?utm_medium=email&utm_source=footer>>.
>
> --
> Kai Muehlbauer
> Institute of Geosciences, Meteorology Section, University of Bonn
> Auf dem Huegel 20       | +49 228 739083
> D-53121 Bonn            | kai.mue...@uni-bonn.de
> <mailto:kai.mue...@uni-bonn.de>
>
> --
> You received this message because you are subscribed to the Google
> Groups "wradlib-users" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to wradlib-user...@googlegroups.com
> <mailto:wradlib-users%2Bunsu...@googlegroups.com>.
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/wradlib-users/0831e896-6cef-8e62-03a1-3e2698cd23df%40uni-bonn.de
> <https://groups.google.com/d/msgid/wradlib-users/0831e896-6cef-8e62-03a1-3e2698cd23df%40uni-bonn.de>.
>
>
>
> --
> Syed Hamid Ali
>
> /M. Tech Atmospheric Science,/
>
> Department of Atmospheric & Space Science,
>
> Savitribai Phule Pune University &
>
> Indian Institute of Tropical Meteorology,
>
> Pune, India.
>
> Mobile : +91 9622222937
>
> GitHub <https://www.github.com/syedhamidali> | Google Scholar
> <https://scholar.google.com/citations?user=f1DO2GEAAAAJ&hl=en> | Twitter
> <https://www.twitter.com/hamidrixvi> | Linkedin
> <https://www.linkedin.com/in/rizvihamid> | Website <https://shuhul.com>
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "wradlib-users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to wradlib-user...@googlegroups.com
> <mailto:wradlib-user...@googlegroups.com>.
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/wradlib-users/CADqG3xCZ52P%2BbM2MV%3D4%3DF-znZpQHQ25GT9G_7nzhgqFMroM6jw%40mail.gmail.com
> <https://groups.google.com/d/msgid/wradlib-users/CADqG3xCZ52P%2BbM2MV%3D4%3DF-znZpQHQ25GT9G_7nzhgqFMroM6jw%40mail.gmail.com?utm_medium=email&utm_source=footer>.

Elton Robaina

unread,
Jan 24, 2022, 10:48:58 AM1/24/22
to wradlib-users
Hi Kai, Syed ,

Thank you so much for the opportunity to be part of this community and for all your help.
I will study your notebooks to better understand each function.
I will contact the institution that sent me the data and request a CAPPI, so we can compare the results.
 When I have the results, I'll post them here to compare.

Thank you very much!



Elton Robaina

unread,
Feb 8, 2022, 9:52:40 AM2/8/22
to wradlib-users
Hi Kai, Syed ,

I put the results obtained by the EDGE software in the previous link for comparison purposes. 
The CAPPI for 15km and 20km did not present results, only the CMAX presents values. 
I'm still trying to understand and compare with your scripts.

thanks!

Syed Hamid Ali

unread,
Feb 10, 2022, 1:02:33 AM2/10/22
to wradli...@googlegroups.com
Hi Elton,

These are the matching results, what do you think?

Best,
Syed

To unsubscribe from this group and stop receiving emails from it, send an email to wradlib-user...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/wradlib-users/f5bad149-12c7-4f28-ade3-dba7c37cfa61n%40googlegroups.com.


--
Syed Hamid Ali

M. Tech Atmospheric Science,

Department of Atmospheric & Space Science,

Savitribai Phule Pune University &

Indian Institute of Tropical Meteorology,

Pune, India.

Mobile : +91 9622222937

cmax.jp2

Syed Hamid Ali

unread,
Feb 10, 2022, 1:04:17 AM2/10/22
to wradli...@googlegroups.com
cmax.jpg

Elton Robaina

unread,
Feb 11, 2022, 7:17:38 AM2/11/22
to wradlib-users
Hi Syed,
When put side by side, we can see the results was similar for CMax. In the EDGE software we can see that more part of DBZH have a range result  from -10 to 28. For the other hand, your results have a range -7 to 28, with peaks of maybe 30-35. I thinks the results is same, only litle different between scale.

What I still don't understand is why the EDGE software didn't capture anything at altitudes of 15km and 20km.

Let me know, what do you think?

Syed Hamid Ali

unread,
Feb 12, 2022, 3:22:04 AM2/12/22
to wradli...@googlegroups.com
Hi Elton,

As I can see from your EDGE software plotted figures, there aren't the vertical panels, so how can you see the vertical reflectivity?
Rest assured, these figures are perfectly fine!!

Cheers
Syed

Elton Robaina

unread,
Feb 12, 2022, 8:32:21 AM2/12/22
to wradli...@googlegroups.com
Hi Syed,

I agree with you. Unfortunately the institution that i received the data did not send the vertical panels for comparison.

About normal CAPPI, do you have idea what happened?
Why did the EDGE software not  captured de normal CAPPI in 15 and 20 km? I'm just curious about it.
I think maybe it's due to the sweep angles, but i'm not sure about it.

Let me know, what do you think?

thanks!




You received this message because you are subscribed to a topic in the Google Groups "wradlib-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/wradlib-users/bMNPcAuX_jQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to wradlib-user...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/wradlib-users/CADqG3xBzAkseR9Lxa0dafV-zGvz85O0vNJRW2sxjLWpcSx6MkA%40mail.gmail.com.


--
Forte abraço!
Atenciosamente,

Elton J. Robaina

Syed Hamid Ali

unread,
Feb 12, 2022, 8:45:55 AM2/12/22
to wradlib-users
Hi Elton,

I haven't ever worked with EDGE, so I can't say anything. If you need further help, feel free to ask.
Best,
Syed

Elton Robaina

unread,
Feb 12, 2022, 9:27:06 AM2/12/22
to wradli...@googlegroups.com
Hi Syed,

I greatly appreciate your help.

Thanks!

Reply all
Reply to author
Forward
0 new messages