# Heuristic clutter detection based on distribution properties (“histo cut”)#

Detects areas with anomalously low or high average reflectivity or precipitation. It is recommended to use long term average or sums (months to year).

[1]:

import wradlib.clutter as clutter
import numpy as np
import matplotlib.pyplot as pl
import warnings

warnings.filterwarnings("ignore")
try:
get_ipython().run_line_magic("matplotlib inline")
except:
pl.ion()


[2]:

filename = util.get_wradlib_data_file("misc/annual_rainfall_fbg.gz")

Downloading file 'misc/annual_rainfall_fbg.gz' from 'https://github.com/wradlib/wradlib-data/raw/pooch/data/misc/annual_rainfall_fbg.gz' to '/home/runner/work/wradlib/wradlib/wradlib-data'.


## Apply histo-cut filter to retrieve boolean array that highlights clutter as well as beam blockage#

Depending on your data and climate you can parameterize the upper and lower frequency percentage with the kwargs upper_frequency/lower_frequency. For European ODIM_H5 data these values have been found to be in the order of 0.05 in EURADCLIM: The European climatological high-resolution gauge-adjusted radar precipitation dataset. The current default is 0.01 for both values.

[3]:

mask = clutter.histo_cut(yearsum)


## Plot results#

[4]:

fig = pl.figure(figsize=(14, 14))
ax, pm = plot_ppi(np.log(yearsum), ax=ax)
pl.title("Logarithm of annual precipitation sum")
pl.colorbar(pm, shrink=0.75)
pl.title("Map of execptionally low and high values\n(clutter and beam blockage)")
pl.colorbar(pm, shrink=0.75)

[4]:

<matplotlib.colorbar.Colorbar at 0x7f5dd01aa050>