# Converting Reflectivity to Rainfall¶

Reflectivity (Z) and precipitation rate (R) can be related in form of a power law $$Z=a \cdot R^b$$. The parameters a and b depend on the type of precipitation (i.e. drop size distribution and water temperature). $$\omega radlib$$ provides a couple of functions that could be useful in this context.

The following example demonstrates the steps to convert from the common unit dBZ (decibel of the reflectivity factor Z) to rainfall intensity (in the unit of mm/h). This is an array of typical reflectivity values (unit: dBZ)

:

dBZ = np.array([20., 30., 40., 45., 50., 55.])
print(dBZ)

[20. 30. 40. 45. 50. 55.]


Convert to reflectivity factor Z (unit: $$mm^6/m^3$$):

:

Z = wrl.trafo.idecibel(dBZ)
print(Z)

[1.00000000e+02 1.00000000e+03 1.00000000e+04 3.16227766e+04
1.00000000e+05 3.16227766e+05]


Convert to rainfall intensity (unit: mm/h) using the Marshall-Palmer Z(R) parameters:

:

R = wrl.zr.z_to_r(Z, a=200., b=1.6)
print(np.round(R, 2))

[ 0.65  2.73 11.53 23.68 48.62 99.85]


Convert to rainfall depth (unit: mm) assuming a rainfall duration of five minutes (i.e. 300 seconds)

:

depth = wrl.trafo.r_to_depth(R, 300)
print(np.round(depth, 2))

[0.05 0.23 0.96 1.97 4.05 8.32]


## An example with real radar data¶

The following example is based on observations of the DWD C-band radar on mount Feldberg (SW-Germany). The figure shows a 15 minute accumulation of rainfall which was produced from three consecutive radar scans at 5 minute intervals between 17:30 and 17:45 on June 8, 2008.

:

def read_data(dtimes):
"""Helper function to read raw data for a list of datetimes <dtimes>
"""
data = np.empty((len(dtimes),360,128))
for i, dtime in enumerate(dtimes):
return data


Read data from radar Feldberg for three consecutive 5 minute intervals and compute the accumulated rainfall depth.

:

# Read
dtimes = ["0806021735","0806021740","0806021745"]
# Convert to rainfall intensity (mm/h)
Z = wrl.trafo.idecibel(dBZ)
R = wrl.zr.z_to_r(Z, a=200., b=1.6)
# Convert to rainfall depth (mm)
depth = wrl.trafo.r_to_depth(R, 300)
# Accumulate 15 minute rainfall depth over all three 5 minute intervals
accum = np.sum(depth, axis=0)


Plot PPI of 15 minute rainfall depth

:

pl.figure(figsize=(10,8))
ax, cf = wrl.vis.plot_ppi(accum, cmap="viridis")

<Figure size 720x576 with 0 Axes> 