wradlib.zr.z_to_r_enhanced(z, polar=True, shower=True)

Calculates rainrates from radar reflectivities using the enhanced three-part Z-R-relationship used by the DWD (as of 2009)

To be used with polar representations so that one dimension is cyclical. i.e. z should be of shape (nazimuths, nbins) –> the first dimension is the cyclical one. For DWD DX-Data z’s shape is (360,128).

Neighborhood-means are taken only for available data via fast convolution sums. Refer to the RADOLAN final report or the RADOLAN System handbook for details on the calculations. Basically, for low reflectivities an index called the shower index is calculated as the mean of the differences along both axis in a neighborhood of 3x3 pixels. This means:

x-direction –>

y | +—+—+—+ | | | 1 | 2 | 3 | d v +—+—+—+ i | 4 | 5 | 6 | r +—+—+—+ e | 7 | 8 | 9 | c +—+—+—+ t i if 5 is the pixel in question, its shower index is calculated as o ( |1-2| + |2-3| + |4-5| + |5-6| + |7-8| + |8-9| + n + |1-4| + |4-7| + |2-5| + |5-8| + |3-6| + |6-9| ) / 12.

then, the upper line of the sum would be diffx (DIFFerences in X-direction), the lower line would be diffy (DIFFerences in Y-direction) in the code below.
Parameters: z (ndarray a floats) – Corresponds to reflectivity Z in mm**6/m**3 ND-array, at least 2D polar (bool) – defaults to to True (polar data), False for cartesian data. shower (bool) – output shower index, defaults to True r (numpy.ndarray) – r - array of shape z.shape - calculated rain rates si (numpy.ndarray) – si - array of shape z.shape - calculated shower index for control purposes. May be omitted in later versions