Depolarization#

This notebook show how to calculate depolarization ratio for weather radars which do not provide this moment. This has been extensively discussed in [Melnikov et al., 2013], [Ryzhkov et al., 2017] and [Kilambi et al., 2018].

import warnings

import matplotlib.pyplot as plt
import numpy as np
import wradlib as wrl
import wradlib_data
import xarray as xr

warnings.filterwarnings("ignore")
/home/docs/checkouts/readthedocs.org/user_builds/wradlib/conda/2.7.0/lib/python3.13/site-packages/tqdm/auto.py:21: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html
  from .autonotebook import tqdm as notebook_tqdm

Open radar sweep#

filename2 = wradlib_data.DATASETS.fetch("hdf5/2014-08-10--182000.ppi.mvol")
swp = xr.open_dataset(filename2, engine="gamic", group="sweep_0")
display(swp)
<xarray.Dataset> Size: 17MB
Dimensions:            (azimuth: 360, range: 1000)
Coordinates:
  * azimuth            (azimuth) float64 3kB 0.5054 1.522 2.527 ... 358.5 359.5
  * range              (range) float32 4kB 50.0 150.0 ... 9.985e+04 9.995e+04
    elevation          (azimuth) float64 3kB ...
    time               (azimuth) datetime64[ns] 3kB ...
    longitude          float64 8B ...
    latitude           float64 8B ...
    altitude           float64 8B ...
Data variables: (12/18)
    KDP                (azimuth, range) float32 1MB ...
    PHIDP              (azimuth, range) float32 1MB ...
    DBZH               (azimuth, range) float32 1MB ...
    DBZV               (azimuth, range) float32 1MB ...
    RHOHV              (azimuth, range) float32 1MB ...
    DBTH               (azimuth, range) float32 1MB ...
    ...                 ...
    sweep_mode         <U20 80B ...
    sweep_number       int64 8B ...
    prt_mode           <U7 28B ...
    follow_mode        <U7 28B ...
    sweep_fixed_angle  float64 8B ...
    nyquist_velocity   object 8B ...
Attributes:
    source:       gamic
    pulse_width:  2

Preprocess polar data#

We georeference the radar sweep coordinates for better visualization.

swp = swp.wrl.georef.georeference()
swp = swp.set_coords("sweep_mode")
display(swp)
<xarray.Dataset> Size: 33MB
Dimensions:            (azimuth: 360, range: 1000)
Coordinates: (12/15)
  * azimuth            (azimuth) float64 3kB 0.5054 1.522 2.527 ... 358.5 359.5
  * range              (range) float32 4kB 50.0 150.0 ... 9.985e+04 9.995e+04
    sweep_mode         <U20 80B 'azimuth_surveillance'
    elevation          (azimuth) float64 3kB 1.505 1.505 1.505 ... 1.505 1.505
    time               (azimuth) datetime64[ns] 3kB ...
    longitude          float64 8B 7.072
    ...                 ...
    y                  (azimuth, range) float64 3MB 49.98 149.9 ... 9.988e+04
    z                  (azimuth, range) float64 3MB 100.8 103.4 ... 3.313e+03
    gr                 (azimuth, range) float64 3MB 49.98 149.9 ... 9.988e+04
    rays               (azimuth, range) float64 3MB 0.5054 0.5054 ... 359.5
    bins               (azimuth, range) float32 1MB 50.0 150.0 ... 9.995e+04
    crs_wkt            int64 8B 0
Data variables: (12/17)
    KDP                (azimuth, range) float32 1MB ...
    PHIDP              (azimuth, range) float32 1MB ...
    DBZH               (azimuth, range) float32 1MB ...
    DBZV               (azimuth, range) float32 1MB ...
    RHOHV              (azimuth, range) float32 1MB ...
    DBTH               (azimuth, range) float32 1MB ...
    ...                 ...
    ZDR                (azimuth, range) float32 1MB ...
    sweep_number       int64 8B ...
    prt_mode           <U7 28B ...
    follow_mode        <U7 28B ...
    sweep_fixed_angle  float64 8B ...
    nyquist_velocity   object 8B ...
Attributes:
    source:       gamic
    pulse_width:  2

Calculate Depolarization#

Please see (depolarization) for details.

dpr =  swp.wrl.dp.depolarization(zdr="ZDR", rho="RHOHV")
plt.figure()
dpr.wrl.vis.plot()
plt.gca().set_title("Depolarization")
plt.tight_layout()
../../_images/8e0b3b9bf48230b195a91d94d4e5758dc94b152119f52479a109f7091b867984.png