Problems with 2D Hydrometeorclassification in wradlib

Hi everybody :wave: ,

I have been trying to use the 2D Membership Function Hydrometeorclassification in wradlib on my own data.

I have been following HMC workflow as it is described in one of the tutorial notebooks on the wradlib website: Hydrometeorclassification — wradlib .

However, the final classification is not really what I expected (see the pic below)

My data describes a cluster of precipitation in the lower part of the plot and the rest of the area is an area with now precipitation at all. But as you can see, the area with no precipitation has been classified as ‘wet snow’.

I have been looking at the source code to better understand what is going on. I have found that when the data contains only 0s (when there is no precipitation) all the precipitation classes are equally probable to occur (accept for the 2 crystal classes). Then the class on the top of the list gets chosen as the final classification (in this case it is ‘wet snow’).

I have tried to modify the code a little bit, but haven’t come up with any good solution. Although I think that the problem is in the wrl.classify.classify() method when calculating the no precipitation probability.

Has anyone faced similar issues, or can you think of a possible solution to this problem?

Hope I explained it clearly, let me know if not. I am still very new to the weather radar data community :grin: .

Thank you for any suggestions :cherry_blossom: ,
Alzbeta S.

Dear Alzbeta @srutkova.alzbeta,

welcome to openradar discourse. Your explanation are very clear and to the point. To be honest, yes that is a known problem, that sometimes this specific failures happen. You’ve also spotted the right location where the NP is introduced.

The code was never touched ever back since (beside handling numpy and style issues) this commit FIX: correct no-precip handling (wrong index) · wradlib/wradlib@0f2d84c · GitHub.

I’m open for any suggestion/help to track this down and fix it.
We’ve also found that sometimes the membership-functions are defined in a too narrow range which also lead to errors in classification.

1 Like

Dear @kmuehlbauer ,

thank you for the answer.

It seems like an interesting problem to solve. I might have a look at it in detail and try to come up with a possible solution. I will let you know, if I come up with something.

Thank you for now :smiling_face:

Dear @kmuehlbauer ,

I’m coming back with a follow up question :grin: .

Is there a paper regarding the wradlib 2D Hydrometeorclassification? Or a paper the classification was inspired by?

I know there is the Reference Library ( ) as well as the Technical Note paper ( But I wonder, if I could find some detailed notes on the choice of the classification algorithm?

Thank you :sunflower: ,
Alzbeta S.

Dear Alzbeta,

in the linked notebook (Hydrometeorclassification — wradlib) there are the references mentioned in the upper part. Maybe we should make it more prominent and also move it to the hmc-function docstrings:

The hydrometeorclassification code is based on the paper by Zrnic 2001 utilizing 2D trapezoidal membership functions based on the paper by Straka et. al 2000 adapted by Evaristo et. al 2013 for X-Band.


1 Like

Dear Kai,

thank you very much!

I totally scrolled past it. I’m more used to references at the end of the page. I should’ve read it more carefully.

Thanks again :slightly_smiling_face:,

Yes, bottom is for sure the more appropriate location. When reworking the notebooks this would be a good idea to makes this a standard. Thanks!