wradlib.zr.ZRMethods#

class wradlib.zr.ZRMethods(obj)[source]#

Bases: XarrayMethods

wradlib xarray SubAccessor methods for zr.

z_to_r(**kwargs)[source]#

Conversion from reflectivities to rain rates.

Calculates rain rates from radar reflectivities using a power law Z/R relationship Z = a*R**b

Parameters:

obj (xarray.DataArray) – Corresponds to reflectivity Z in mm**6/m**3

Keyword Arguments:
  • a (float) – Parameter a of the Z/R-relationship Standard value according to Marshall-Palmer is a=200., b=1.6

  • b (float) – Parameter b of the Z/R-relationship Standard value according to Marshall-Palmer is b=1.6

Note

The German Weather Service uses a=256 and b=1.42 instead of the Marshall-Palmer defaults.

Returns:

output (xarray.DataArray) – rainfall intensity in mm/h

r_to_z(**kwargs)[source]#

Calculates reflectivity from rain rates using a power law Z/R relationship Z = a*R**b

Parameters:
  • obj (xarray.DataArray) – Corresponds to rainfall intensity in mm/h

  • a (float) – Parameter a of the Z/R-relationship Standard value according to Marshall-Palmer is a=200., b=1.6

  • b (float) – Parameter b of the Z/R-relationship Standard value according to Marshall-Palmer is b=1.6

Note

The German Weather Service uses a=256 and b=1.42 instead of the Marshall-Palmer defaults.

Returns:

output (xarray.DataArray) – reflectivity in mm**6/m**3

z_to_r_enhanced(**kwargs)[source]#

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
l
d
i
r

1

2

3

4

5

6

7

8

9

If 5 is the pixel in question, it’s shower index is calculated as:

\[\begin{split}( &|1-2| + |2-3| + |4-5| + |5-6| + |7-8| + |8-9| + \\ &|1-4| + |4-7| + |2-5| + |5-8| + |3-6| + |6-9| ) / 12.\end{split}\]

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:

obj (xarray.DataArray) – Corresponds to reflectivity Z in mm**6/m**3 ND-array, at least 2D

Keyword Arguments:

shower (bool) – output shower index, defaults to True

Returns:

r_to_z(**kwargs)

Calculates reflectivity from rain rates using a power law Z/R relationship Z = a*R**b

z_to_r(**kwargs)

Conversion from reflectivities to rain rates.

z_to_r_enhanced(**kwargs)

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