Wind retrievel for RPG radar¶

lidarwind is the package name used to retrieve wind profiles from the radar PPI scans. The package was initially developed to process wind lidar data (https://doi.org/10.21105/joss.04852). Because the physical principle of retrieving wind from lidar and radar observations is the same, lidarwind was extended to support the RPG radar data. Below, you will find an example of lidarwind applied to RPG PPI radar data.

You can find more information about lidarwind at: https://lidarwind.readthedocs.io/

Steps:¶

  1. Dependence installation
  2. Importing the required packages
  3. Defining useful functions
  4. Getting sample data
  5. Retrieving wind
  6. Visualising the results

Step 1: Dependence installation¶

The cell below installs an additional package required by lidarwind.

In [1]:
pip install lidarwind xarray==2024.3.0 xarray-datatree==0.0.14 
Requirement already satisfied: lidarwind in /Users/jdiasneto/miniforge3/envs/ccres/lib/python3.14/site-packages (1.0.1)
Requirement already satisfied: xarray==2024.3.0 in /Users/jdiasneto/miniforge3/envs/ccres/lib/python3.14/site-packages (2024.3.0)
Requirement already satisfied: xarray-datatree==0.0.14 in /Users/jdiasneto/miniforge3/envs/ccres/lib/python3.14/site-packages (0.0.14)
Requirement already satisfied: numpy>=1.23 in /Users/jdiasneto/miniforge3/envs/ccres/lib/python3.14/site-packages (from xarray==2024.3.0) (2.4.6)
Requirement already satisfied: packaging>=22 in /Users/jdiasneto/miniforge3/envs/ccres/lib/python3.14/site-packages (from xarray==2024.3.0) (26.2)
Requirement already satisfied: pandas>=1.5 in /Users/jdiasneto/miniforge3/envs/ccres/lib/python3.14/site-packages (from xarray==2024.3.0) (3.0.3)
Requirement already satisfied: xrft>=0.3 in /Users/jdiasneto/miniforge3/envs/ccres/lib/python3.14/site-packages (from lidarwind) (1.0.1)
Requirement already satisfied: netCDF4>=1.5 in /Users/jdiasneto/miniforge3/envs/ccres/lib/python3.14/site-packages (from lidarwind) (1.7.4)
Requirement already satisfied: matplotlib>=3.4.3 in /Users/jdiasneto/miniforge3/envs/ccres/lib/python3.14/site-packages (from lidarwind) (3.10.9)
Requirement already satisfied: click>=8.1.2 in /Users/jdiasneto/miniforge3/envs/ccres/lib/python3.14/site-packages (from lidarwind) (8.4.1)
Requirement already satisfied: gdown>=4.5.1 in /Users/jdiasneto/miniforge3/envs/ccres/lib/python3.14/site-packages (from lidarwind) (6.0.0)
Requirement already satisfied: pooch>=1.6 in /Users/jdiasneto/miniforge3/envs/ccres/lib/python3.14/site-packages (from lidarwind) (1.9.0)
Requirement already satisfied: beautifulsoup4 in /Users/jdiasneto/miniforge3/envs/ccres/lib/python3.14/site-packages (from gdown>=4.5.1->lidarwind) (4.14.3)
Requirement already satisfied: filelock in /Users/jdiasneto/miniforge3/envs/ccres/lib/python3.14/site-packages (from gdown>=4.5.1->lidarwind) (3.29.0)
Requirement already satisfied: requests[socks] in /Users/jdiasneto/miniforge3/envs/ccres/lib/python3.14/site-packages (from gdown>=4.5.1->lidarwind) (2.34.2)
Requirement already satisfied: tqdm in /Users/jdiasneto/miniforge3/envs/ccres/lib/python3.14/site-packages (from gdown>=4.5.1->lidarwind) (4.67.3)
Requirement already satisfied: contourpy>=1.0.1 in /Users/jdiasneto/miniforge3/envs/ccres/lib/python3.14/site-packages (from matplotlib>=3.4.3->lidarwind) (1.3.3)
Requirement already satisfied: cycler>=0.10 in /Users/jdiasneto/miniforge3/envs/ccres/lib/python3.14/site-packages (from matplotlib>=3.4.3->lidarwind) (0.12.1)
Requirement already satisfied: fonttools>=4.22.0 in /Users/jdiasneto/miniforge3/envs/ccres/lib/python3.14/site-packages (from matplotlib>=3.4.3->lidarwind) (4.63.0)
Requirement already satisfied: kiwisolver>=1.3.1 in /Users/jdiasneto/miniforge3/envs/ccres/lib/python3.14/site-packages (from matplotlib>=3.4.3->lidarwind) (1.5.0)
Requirement already satisfied: pillow>=8 in /Users/jdiasneto/miniforge3/envs/ccres/lib/python3.14/site-packages (from matplotlib>=3.4.3->lidarwind) (12.2.0)
Requirement already satisfied: pyparsing>=3 in /Users/jdiasneto/miniforge3/envs/ccres/lib/python3.14/site-packages (from matplotlib>=3.4.3->lidarwind) (3.3.2)
Requirement already satisfied: python-dateutil>=2.7 in /Users/jdiasneto/miniforge3/envs/ccres/lib/python3.14/site-packages (from matplotlib>=3.4.3->lidarwind) (2.9.0.post0)
Requirement already satisfied: cftime in /Users/jdiasneto/miniforge3/envs/ccres/lib/python3.14/site-packages (from netCDF4>=1.5->lidarwind) (1.6.5)
Requirement already satisfied: certifi in /Users/jdiasneto/miniforge3/envs/ccres/lib/python3.14/site-packages (from netCDF4>=1.5->lidarwind) (2026.5.20)
Requirement already satisfied: platformdirs>=2.5.0 in /Users/jdiasneto/miniforge3/envs/ccres/lib/python3.14/site-packages (from pooch>=1.6->lidarwind) (4.9.6)
Requirement already satisfied: six>=1.5 in /Users/jdiasneto/miniforge3/envs/ccres/lib/python3.14/site-packages (from python-dateutil>=2.7->matplotlib>=3.4.3->lidarwind) (1.17.0)
Requirement already satisfied: charset_normalizer<4,>=2 in /Users/jdiasneto/miniforge3/envs/ccres/lib/python3.14/site-packages (from requests[socks]->gdown>=4.5.1->lidarwind) (3.4.7)
Requirement already satisfied: idna<4,>=2.5 in /Users/jdiasneto/miniforge3/envs/ccres/lib/python3.14/site-packages (from requests[socks]->gdown>=4.5.1->lidarwind) (3.15)
Requirement already satisfied: urllib3<3,>=1.26 in /Users/jdiasneto/miniforge3/envs/ccres/lib/python3.14/site-packages (from requests[socks]->gdown>=4.5.1->lidarwind) (2.7.0)
Requirement already satisfied: dask in /Users/jdiasneto/miniforge3/envs/ccres/lib/python3.14/site-packages (from xrft>=0.3->lidarwind) (2026.3.0)
Requirement already satisfied: scipy in /Users/jdiasneto/miniforge3/envs/ccres/lib/python3.14/site-packages (from xrft>=0.3->lidarwind) (1.17.1)
Requirement already satisfied: soupsieve>=1.6.1 in /Users/jdiasneto/miniforge3/envs/ccres/lib/python3.14/site-packages (from beautifulsoup4->gdown>=4.5.1->lidarwind) (2.8.3)
Requirement already satisfied: typing-extensions>=4.0.0 in /Users/jdiasneto/miniforge3/envs/ccres/lib/python3.14/site-packages (from beautifulsoup4->gdown>=4.5.1->lidarwind) (4.15.0)
Requirement already satisfied: cloudpickle>=3.0.0 in /Users/jdiasneto/miniforge3/envs/ccres/lib/python3.14/site-packages (from dask->xrft>=0.3->lidarwind) (3.1.2)
Requirement already satisfied: fsspec>=2021.09.0 in /Users/jdiasneto/miniforge3/envs/ccres/lib/python3.14/site-packages (from dask->xrft>=0.3->lidarwind) (2026.4.0)
Requirement already satisfied: partd>=1.4.0 in /Users/jdiasneto/miniforge3/envs/ccres/lib/python3.14/site-packages (from dask->xrft>=0.3->lidarwind) (1.4.2)
Requirement already satisfied: pyyaml>=5.3.1 in /Users/jdiasneto/miniforge3/envs/ccres/lib/python3.14/site-packages (from dask->xrft>=0.3->lidarwind) (6.0.3)
Requirement already satisfied: toolz>=0.12.0 in /Users/jdiasneto/miniforge3/envs/ccres/lib/python3.14/site-packages (from dask->xrft>=0.3->lidarwind) (1.1.0)
Requirement already satisfied: locket in /Users/jdiasneto/miniforge3/envs/ccres/lib/python3.14/site-packages (from partd>=1.4.0->dask->xrft>=0.3->lidarwind) (1.0.0)
Requirement already satisfied: PySocks!=1.5.7,>=1.5.6 in /Users/jdiasneto/miniforge3/envs/ccres/lib/python3.14/site-packages (from requests[socks]->gdown>=4.5.1->lidarwind) (1.7.1)
Note: you may need to restart the kernel to use updated packages.
In [2]:
pip list | grep xarray
xarray                    2024.3.0
xarray-datatree           0.0.14
Note: you may need to restart the kernel to use updated packages.

ATTENTION:¶

After executing the previous cell, you may need to restart the kernel. It is a temporary solution.

Step 2: Importing required packages¶

Here, we import some basic packages usefull for processing the sample data. Later, lidarwind is also imported and its versions is checked; it should be greater or equal to 0.2.4. After, the RPG related modules are also imported.

In [3]:
# genneral imports
import pooch

import xarray as xr
import matplotlib.pyplot as plt
/Users/jdiasneto/miniforge3/envs/ccres/lib/python3.14/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
In [4]:
# importing the data processing package
import lidarwind

# checking if the version of lidarwind
# it should be equal or greater than 0.2.4
print(f"lidarwind version: {lidarwind.__version__}")

# if there is a ModuleNotFoundError, run de code bellow and then restart the kernel
# pip install "setuptools<82"
/Users/jdiasneto/miniforge3/envs/ccres/lib/python3.14/site-packages/lidarwind/__init__.py:8: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.
  from pkg_resources import DistributionNotFound, get_distribution
lidarwind version: 1.0.1
In [5]:
# importing the rpg radar related modules
from lidarwind.preprocessing import rpg_radar
from lidarwind.postprocessing import post_rpg_radar

Step 3: Defining the processing function¶

The following is in charge of the main process. Here, the individual PPI files are open and the profiles are retrieved.

In [6]:
def process_one_file(file_name):
    """
    Function to process a single radar file
    """

    ds = xr.open_dataset(file_name)
    ds = rpg_radar.rpg_slanted_radial_velocity_4_fft(ds)
    tmp_wind = post_rpg_radar.get_horizontal_wind(ds)

    return tmp_wind

Step 4: Getting sample data¶

In this step, we download a sample dataset needed for this example and create a list of all downloaded files.

In [7]:
file_list = pooch.retrieve(
    url="doi:10.5281/zenodo.7312960/rpg_sample_ppi.zip",
    known_hash="md5:952f7b50985cc8623933fbc18f72fd73",
    path="tmp_data",
    processor=pooch.Unzip(),
        )

file_list = sorted(file_list)
Downloading data from 'doi:10.5281/zenodo.7312960/rpg_sample_ppi.zip' to file '/Users/jdiasneto/Projects/actris_training/tmp_data/07aeaafc2e521ab168c1a2823840fe77-rpg_sample_ppi.zip'.
Unzipping contents of '/Users/jdiasneto/Projects/actris_training/tmp_data/07aeaafc2e521ab168c1a2823840fe77-rpg_sample_ppi.zip' to '/Users/jdiasneto/Projects/actris_training/tmp_data/07aeaafc2e521ab168c1a2823840fe77-rpg_sample_ppi.zip.unzip'

Step 5: Retrieving wind¶

In this step, the function defined in Step 3 to process the sample files is applied to the file_list defined in Step 4.

In [8]:
%%time

# running the function over the selected files
wind_ds = xr.merge([process_one_file(f) for f in file_list])
CPU times: user 35.6 s, sys: 634 ms, total: 36.2 s
Wall time: 36.7 s

Step 6: Visualising the results¶

Finally, in this step, we first have a look at the wind dataset structure and later have a loot at some variables.

In [9]:
# Checking the wind dataset
wind_ds
Out[9]:
<xarray.Dataset> Size: 631kB
Dimensions:                    (range: 339, chirp: 3, mean_time: 42)
Coordinates:
  * range                      (range) float32 1kB 108.0 129.6 ... 1.157e+04
  * chirp                      (chirp) int64 24B 1 2 3
  * mean_time                  (mean_time) datetime64[ns] 336B 2022-05-17T10:...
    elevation                  float32 4B 74.99
    freq_azimuth               float64 8B 0.002778
    azimuth_length             int64 8B 72
Data variables:
    horizontal_wind_direction  (mean_time, range) float64 114kB 82.05 ... nan
    horizontal_wind_speed      (mean_time, range) float64 114kB 4.536 ... nan
    meridional_wind            (mean_time, range) float64 114kB -0.6275 ... nan
    zonal_wind                 (mean_time, range) float64 114kB 4.493 ... nan
    start_scan                 (mean_time) datetime64[ns] 336B 2022-05-17T10:...
    end_scan                   (mean_time) datetime64[ns] 336B 2022-05-17T10:...
    zdr_max                    (mean_time, range) float32 57kB 5.533 ... nan
    nan_percentual             (mean_time, range) float64 114kB 0.0 ... 100.0
    chirp_start                (mean_time, chirp) float32 504B 111.8 ... 2.03...
    chirp_end                  (mean_time, chirp) float32 504B 581.3 ... 1.19...
    chirp_azimuth_bias         (mean_time, chirp) float64 1kB 0.0 0.0 ... 0.0
    azm_seq                    (mean_time) float64 336B 1.0 -1.0 ... 1.0 -1.0
xarray.Dataset
    • range: 339
    • chirp: 3
    • mean_time: 42
    • range
      (range)
      float32
      108.0 129.6 ... 1.153e+04 1.157e+04
      units :
      m
      name :
      range
      comment :
      height estimated from the original range and elevation
      array([  107.98101,   129.57721,   151.1734 , ..., 11493.517  , 11529.889  ,
             11566.26   ], shape=(339,), dtype=float32)
    • chirp
      (chirp)
      int64
      1 2 3
      array([1, 2, 3])
    • mean_time
      (mean_time)
      datetime64[ns]
      2022-05-17T10:01:35.830779220 .....
      comment :
      mean time (seconds) from each PPI scan
      array(['2022-05-17T10:01:35.830779220', '2022-05-17T10:03:00.880759493',
             '2022-05-17T10:04:26.918101265', '2022-05-17T10:05:53.443717948',
             '2022-05-17T10:07:19.483846153', '2022-05-17T10:08:51.280384615',
             '2022-05-17T10:10:18.800129870', '2022-05-17T10:11:44.335217949',
             '2022-05-17T10:13:09.879831166', '2022-05-17T10:14:35.415999993',
             '2022-05-17T10:16:00.958662340', '2022-05-17T10:17:26.000480516',
             '2022-05-17T10:18:51.040480510', '2022-05-17T10:20:16.576000003',
             '2022-05-17T10:21:41.613307693', '2022-05-17T10:23:07.645871786',
             '2022-05-17T10:24:33.182886075', '2022-05-17T10:26:05.461358974',
             '2022-05-17T10:27:31.496230769', '2022-05-17T10:28:57.029662337',
             '2022-05-17T10:30:22.080831168', '2022-05-17T10:31:47.616230769',
             '2022-05-17T10:33:13.646615384', '2022-05-17T10:34:39.686358974',
             '2022-05-17T10:36:05.727000004', '2022-05-17T10:37:31.261481008',
             '2022-05-17T10:38:57.786205131', '2022-05-17T10:40:23.321831176',
             '2022-05-17T10:41:47.865307693', '2022-05-17T10:43:19.652743591',
             '2022-05-17T10:44:45.691717948', '2022-05-17T10:46:11.727615384',
             '2022-05-17T10:47:37.768358974', '2022-05-17T10:49:02.806307692',
             '2022-05-17T10:50:28.838871794', '2022-05-17T10:51:53.877717948',
             '2022-05-17T10:53:19.907076923', '2022-05-17T10:54:45.441721518',
             '2022-05-17T10:56:11.471662337', '2022-05-17T10:57:36.511662337',
             '2022-05-17T10:59:02.047807698', '2022-05-17T11:00:33.718896101'],
            dtype='datetime64[ns]')
    • elevation
      ()
      float32
      74.99
      Name :
      Elevation
      Units :
      deg
      array(74.99, dtype=float32)
    • freq_azimuth
      ()
      float64
      0.002778
      spacing :
      0.002777777777777782
      direct_lag :
      180
      array(0.00277778)
    • azimuth_length
      ()
      int64
      72
      comment :
      size of the azimuth coordinate
      array(72)
    • horizontal_wind_direction
      (mean_time, range)
      float64
      82.05 79.69 87.19 ... nan nan nan
      name :
      wind direction
      units :
      deg
      comments :
      horizontal wind direction retrived using the FFT method with respect to true north
      info :
      0=wind coming from the north, 90=east, 180=south, 270=west
      array([[ 82.04879937,  79.68815761,  87.18918881, ...,          nan,
                       nan,          nan],
             [101.90865544, 102.03428783, 108.98835195, ...,          nan,
                       nan,          nan],
             [105.39191908, 103.52910987,  99.48177222, ...,          nan,
                       nan,          nan],
             ...,
             [ 93.49667527,  97.88265051,  86.54973375, ...,          nan,
                       nan,          nan],
             [122.07450652, 124.91572877, 122.07674197, ...,          nan,
                       nan,          nan],
             [136.70125445, 144.44080913, 152.55159704, ...,          nan,
                       nan,          nan]], shape=(42, 339))
    • horizontal_wind_speed
      (mean_time, range)
      float64
      4.536 4.254 4.119 ... nan nan nan
      name :
      wind speed
      units :
      m s-1
      comments :
      horizontal wind speed retrived using the FFT method
      array([[4.53636386, 4.25375274, 4.11942253, ...,        nan,        nan,
                     nan],
             [6.68059252, 6.76361453, 6.20638932, ...,        nan,        nan,
                     nan],
             [6.3564044 , 7.33474957, 6.71616601, ...,        nan,        nan,
                     nan],
             ...,
             [4.72829681, 4.71016782, 5.8194779 , ...,        nan,        nan,
                     nan],
             [4.71299183, 4.6376406 , 5.00992205, ...,        nan,        nan,
                     nan],
             [7.77555032, 8.60158547, 9.39089713, ...,        nan,        nan,
                     nan]], shape=(42, 339))
    • meridional_wind
      (mean_time, range)
      float64
      -0.6275 -0.7614 -0.202 ... nan nan
      name :
      meridional wind
      units :
      m s-1
      comments :
      meridional wind retrieved using the FFT method
      array([[-0.62751353, -0.76144543, -0.20200921, ...,         nan,
                      nan,         nan],
             [ 1.37855364,  1.41019342,  2.01940968, ...,         nan,
                      nan,         nan],
             [ 1.68711775,  1.71588661,  1.10637972, ...,         nan,
                      nan,         nan],
             ...,
             [ 0.28838176,  0.64597412, -0.35022851, ...,         nan,
                      nan,         nan],
             [ 2.50270048,  2.65445098,  2.66054247, ...,         nan,
                      nan,         nan],
             [ 5.65895045,  6.9975203 ,  8.33372905, ...,         nan,
                      nan,         nan]], shape=(42, 339))
    • zonal_wind
      (mean_time, range)
      float64
      4.493 4.185 4.114 ... nan nan nan
      name :
      zonal wind
      units :
      m s-1
      comments :
      zonal wind retrieved using the FFT method
      array([[4.49275236, 4.18504638, 4.11446646, ...,        nan,        nan,
                     nan],
             [6.53681163, 6.6149706 , 5.86866705, ...,        nan,        nan,
                     nan],
             [6.12841828, 7.131219  , 6.62441014, ...,        nan,        nan,
                     nan],
             ...,
             [4.71949432, 4.66566162, 5.80892959, ...,        nan,        nan,
                     nan],
             [3.99359266, 3.80284108, 4.24509513, ...,        nan,        nan,
                     nan],
             [5.33249121, 5.00219774, 4.32873064, ...,        nan,        nan,
                     nan]], shape=(42, 339))
    • start_scan
      (mean_time)
      datetime64[ns]
      2022-05-17T10:00:58.190000 ... 2...
      Name :
      Time
      Units :
      Number of seconds since 1/1/2001 00:00:00 [UTC]
      array(['2022-05-17T10:00:58.190000000', '2022-05-17T10:02:22.250000000',
             '2022-05-17T10:03:48.280000000', '2022-05-17T10:05:15.300000000',
             '2022-05-17T10:06:41.340000000', '2022-05-17T10:08:13.130000000',
             '2022-05-17T10:09:41.160000000', '2022-05-17T10:11:06.200000000',
             '2022-05-17T10:12:32.241000064', '2022-05-17T10:13:57.281000064',
             '2022-05-17T10:15:23.310999936', '2022-05-17T10:16:48.360999936',
             '2022-05-17T10:18:13.391000064', '2022-05-17T10:19:38.440999936',
             '2022-05-17T10:21:03.470999936', '2022-05-17T10:22:29.511000064',
             '2022-05-17T10:23:54.552000000', '2022-05-17T10:25:27.312000000',
             '2022-05-17T10:26:53.362000000', '2022-05-17T10:28:19.382000000',
             '2022-05-17T10:29:44.442000000', '2022-05-17T10:31:09.482000000',
             '2022-05-17T10:32:35.512000000', '2022-05-17T10:34:01.552000000',
             '2022-05-17T10:35:27.592000000', '2022-05-17T10:36:52.623000064',
             '2022-05-17T10:38:19.643000064', '2022-05-17T10:39:45.682999936',
             '2022-05-17T10:41:09.723000064', '2022-05-17T10:42:41.503000064',
             '2022-05-17T10:44:07.552999936', '2022-05-17T10:45:33.593000064',
             '2022-05-17T10:46:59.633000064', '2022-05-17T10:48:24.664000000',
             '2022-05-17T10:49:50.704000000', '2022-05-17T10:51:15.744000000',
             '2022-05-17T10:52:41.764000000', '2022-05-17T10:54:06.804000000',
             '2022-05-17T10:55:33.824000000', '2022-05-17T10:56:58.864000000',
             '2022-05-17T10:58:23.904000000', '2022-05-17T10:59:55.695000064'],
            dtype='datetime64[ns]')
    • end_scan
      (mean_time)
      datetime64[ns]
      2022-05-17T10:02:13.480000 ... 2...
      Name :
      Time
      Units :
      Number of seconds since 1/1/2001 00:00:00 [UTC]
      array(['2022-05-17T10:02:13.480000000', '2022-05-17T10:03:39.520000000',
             '2022-05-17T10:05:05.560000000', '2022-05-17T10:06:31.590000000',
             '2022-05-17T10:07:57.630000000', '2022-05-17T10:09:29.430000000',
             '2022-05-17T10:10:56.450000000', '2022-05-17T10:12:22.480999936',
             '2022-05-17T10:13:47.531000064', '2022-05-17T10:15:13.570999936',
             '2022-05-17T10:16:38.610999936', '2022-05-17T10:18:03.651000064',
             '2022-05-17T10:19:28.690999936', '2022-05-17T10:20:54.720999936',
             '2022-05-17T10:22:19.761000064', '2022-05-17T10:23:45.791000064',
             '2022-05-17T10:25:11.822000000', '2022-05-17T10:26:43.602000000',
             '2022-05-17T10:28:09.642000000', '2022-05-17T10:29:34.682000000',
             '2022-05-17T10:30:59.732000000', '2022-05-17T10:32:25.762000000',
             '2022-05-17T10:33:51.792000000', '2022-05-17T10:35:17.832000000',
             '2022-05-17T10:36:43.873000064', '2022-05-17T10:38:09.902999936',
             '2022-05-17T10:39:35.932999936', '2022-05-17T10:41:00.973000064',
             '2022-05-17T10:42:26.013000064', '2022-05-17T10:43:57.792999936',
             '2022-05-17T10:45:23.832999936', '2022-05-17T10:46:49.873000064',
             '2022-05-17T10:48:15.914000000', '2022-05-17T10:49:40.954000000',
             '2022-05-17T10:51:06.984000000', '2022-05-17T10:52:32.024000000',
             '2022-05-17T10:53:58.054000000', '2022-05-17T10:55:24.084000000',
             '2022-05-17T10:56:49.124000000', '2022-05-17T10:58:14.164000000',
             '2022-05-17T10:59:40.195000064', '2022-05-17T11:01:11.400000000'],
            dtype='datetime64[ns]')
    • zdr_max
      (mean_time, range)
      float32
      5.533 6.141 6.962 ... nan nan nan
      Name :
      Maximum ZDR
      units :
      dB
      Comment :
      Maximum ZDR per complete PPI scan
      array([[5.5331583, 6.141076 , 6.962328 , ...,       nan,       nan,
                    nan],
             [8.961918 , 7.182236 , 5.239216 , ...,       nan,       nan,
                    nan],
             [7.1929893, 4.9451785, 6.8622394, ...,       nan,       nan,
                    nan],
             ...,
             [6.1269   , 7.221713 , 6.077519 , ...,       nan,       nan,
                    nan],
             [6.898547 , 5.898196 , 5.7665577, ...,       nan,       nan,
                    nan],
             [7.5182233, 7.522902 , 7.0381165, ...,       nan,       nan,
                    nan]], shape=(42, 339), dtype=float32)
    • nan_percentual
      (mean_time, range)
      float64
      0.0 0.0 0.0 ... 100.0 100.0 100.0
      comment :
      Percentual of NaN per single PPI scan
      array([[  0.        ,   0.        ,   0.        , ..., 100.        ,
              100.        , 100.        ],
             [  3.79746835,   1.26582278,   1.26582278, ..., 100.        ,
              100.        , 100.        ],
             [  0.        ,   0.        ,   1.26582278, ..., 100.        ,
              100.        , 100.        ],
             ...,
             [  0.        ,   0.        ,   0.        , ..., 100.        ,
              100.        , 100.        ],
             [  0.        ,   0.        ,   0.        , ..., 100.        ,
              100.        , 100.        ],
             [  2.5974026 ,   0.        ,   1.2987013 , ..., 100.        ,
              100.        , 100.        ]], shape=(42, 339))
    • chirp_start
      (mean_time, chirp)
      float32
      111.8 621.0 ... 621.0 2.033e+03
      units :
      m
      comment :
      starting height from each chirp sequence
      array([[ 111.795395,  620.987   , 2033.4624  ],
             [ 111.795395,  620.987   , 2033.4624  ],
             [ 111.795395,  620.987   , 2033.4624  ],
             [ 111.795395,  620.987   , 2033.4624  ],
             [ 111.795395,  620.987   , 2033.4624  ],
             [ 111.795395,  620.987   , 2033.4624  ],
             [ 111.795395,  620.987   , 2033.4624  ],
             [ 111.795395,  620.987   , 2033.4624  ],
             [ 111.795395,  620.987   , 2033.4624  ],
             [ 111.795395,  620.987   , 2033.4624  ],
             [ 111.795395,  620.987   , 2033.4624  ],
             [ 111.795395,  620.987   , 2033.4624  ],
             [ 111.795395,  620.987   , 2033.4624  ],
             [ 111.795395,  620.987   , 2033.4624  ],
             [ 111.795395,  620.987   , 2033.4624  ],
             [ 111.795395,  620.987   , 2033.4624  ],
             [ 111.795395,  620.987   , 2033.4624  ],
             [ 111.795395,  620.987   , 2033.4624  ],
             [ 111.795395,  620.987   , 2033.4624  ],
             [ 111.795395,  620.987   , 2033.4624  ],
      ...
             [ 111.795395,  620.987   , 2033.4624  ],
             [ 111.795395,  620.987   , 2033.4624  ],
             [ 111.795395,  620.987   , 2033.4624  ],
             [ 111.795395,  620.987   , 2033.4624  ],
             [ 111.795395,  620.987   , 2033.4624  ],
             [ 111.795395,  620.987   , 2033.4624  ],
             [ 111.795395,  620.987   , 2033.4624  ],
             [ 111.795395,  620.987   , 2033.4624  ],
             [ 111.795395,  620.987   , 2033.4624  ],
             [ 111.795395,  620.987   , 2033.4624  ],
             [ 111.795395,  620.987   , 2033.4624  ],
             [ 111.795395,  620.987   , 2033.4624  ],
             [ 111.795395,  620.987   , 2033.4624  ],
             [ 111.795395,  620.987   , 2033.4624  ],
             [ 111.795395,  620.987   , 2033.4624  ],
             [ 111.795395,  620.987   , 2033.4624  ],
             [ 111.795395,  620.987   , 2033.4624  ],
             [ 111.795395,  620.987   , 2033.4624  ],
             [ 111.795395,  620.987   , 2033.4624  ],
             [ 111.795395,  620.987   , 2033.4624  ]], dtype=float32)
    • chirp_end
      (mean_time, chirp)
      float32
      581.3 1.998e+03 ... 1.197e+04
      units :
      m
      comment :
      ending height from each chirp sequence
      array([[  581.33606,  1997.9583 , 11974.834  ],
             [  581.33606,  1997.9583 , 11974.834  ],
             [  581.33606,  1997.9583 , 11974.834  ],
             [  581.33606,  1997.9583 , 11974.834  ],
             [  581.33606,  1997.9583 , 11974.834  ],
             [  581.33606,  1997.9583 , 11974.834  ],
             [  581.33606,  1997.9583 , 11974.834  ],
             [  581.33606,  1997.9583 , 11974.834  ],
             [  581.33606,  1997.9583 , 11974.834  ],
             [  581.33606,  1997.9583 , 11974.834  ],
             [  581.33606,  1997.9583 , 11974.834  ],
             [  581.33606,  1997.9583 , 11974.834  ],
             [  581.33606,  1997.9583 , 11974.834  ],
             [  581.33606,  1997.9583 , 11974.834  ],
             [  581.33606,  1997.9583 , 11974.834  ],
             [  581.33606,  1997.9583 , 11974.834  ],
             [  581.33606,  1997.9583 , 11974.834  ],
             [  581.33606,  1997.9583 , 11974.834  ],
             [  581.33606,  1997.9583 , 11974.834  ],
             [  581.33606,  1997.9583 , 11974.834  ],
      ...
             [  581.33606,  1997.9583 , 11974.834  ],
             [  581.33606,  1997.9583 , 11974.834  ],
             [  581.33606,  1997.9583 , 11974.834  ],
             [  581.33606,  1997.9583 , 11974.834  ],
             [  581.33606,  1997.9583 , 11974.834  ],
             [  581.33606,  1997.9583 , 11974.834  ],
             [  581.33606,  1997.9583 , 11974.834  ],
             [  581.33606,  1997.9583 , 11974.834  ],
             [  581.33606,  1997.9583 , 11974.834  ],
             [  581.33606,  1997.9583 , 11974.834  ],
             [  581.33606,  1997.9583 , 11974.834  ],
             [  581.33606,  1997.9583 , 11974.834  ],
             [  581.33606,  1997.9583 , 11974.834  ],
             [  581.33606,  1997.9583 , 11974.834  ],
             [  581.33606,  1997.9583 , 11974.834  ],
             [  581.33606,  1997.9583 , 11974.834  ],
             [  581.33606,  1997.9583 , 11974.834  ],
             [  581.33606,  1997.9583 , 11974.834  ],
             [  581.33606,  1997.9583 , 11974.834  ],
             [  581.33606,  1997.9583 , 11974.834  ]], dtype=float32)
    • chirp_azimuth_bias
      (mean_time, chirp)
      float64
      0.0 0.0 0.0 0.0 ... 0.0 0.0 0.0 0.0
      units :
      deg
      comment :
      wind direction bias correcting factor
      array([[0., 0., 0.],
             [0., 0., 0.],
             [0., 0., 0.],
             [0., 0., 0.],
             [0., 0., 0.],
             [0., 0., 0.],
             [0., 0., 0.],
             [0., 0., 0.],
             [0., 0., 0.],
             [0., 0., 0.],
             [0., 0., 0.],
             [0., 0., 0.],
             [0., 0., 0.],
             [0., 0., 0.],
             [0., 0., 0.],
             [0., 0., 0.],
             [0., 0., 0.],
             [0., 0., 0.],
             [0., 0., 0.],
             [0., 0., 0.],
      ...
             [0., 0., 0.],
             [0., 0., 0.],
             [0., 0., 0.],
             [0., 0., 0.],
             [0., 0., 0.],
             [0., 0., 0.],
             [0., 0., 0.],
             [0., 0., 0.],
             [0., 0., 0.],
             [0., 0., 0.],
             [0., 0., 0.],
             [0., 0., 0.],
             [0., 0., 0.],
             [0., 0., 0.],
             [0., 0., 0.],
             [0., 0., 0.],
             [0., 0., 0.],
             [0., 0., 0.],
             [0., 0., 0.],
             [0., 0., 0.]])
    • azm_seq
      (mean_time)
      float64
      1.0 -1.0 1.0 -1.0 ... -1.0 1.0 -1.0
      comment :
      1: azimuth increasing; -1: azimuth decreasing
      array([ 1., -1.,  1., -1.,  1., -1.,  1., -1.,  1., -1.,  1., -1.,  1.,
             -1.,  1., -1.,  1., -1.,  1., -1.,  1., -1.,  1., -1.,  1., -1.,
              1., -1.,  1., -1.,  1., -1.,  1., -1.,  1., -1.,  1., -1.,  1.,
             -1.,  1., -1.])
    • range
      PandasIndex
      PandasIndex(Index([107.98101043701172, 129.57720947265625, 151.17340087890625,
              172.7696075439453, 194.36581420898438, 215.96202087402344,
              237.5582275390625,  259.1544189453125,  280.7506103515625,
              302.3468017578125,
             ...
               11238.9130859375,   11275.2861328125,   11311.6572265625,
               11348.0283203125,   11384.4013671875,   11420.7724609375,
                 11457.14453125,   11493.5166015625,    11529.888671875,
                11566.259765625],
            dtype='float32', name='range', length=339))
    • chirp
      PandasIndex
      PandasIndex(Index([1, 2, 3], dtype='int64', name='chirp'))
    • mean_time
      PandasIndex
      PandasIndex(DatetimeIndex(['2022-05-17 10:01:35.830779220',
                     '2022-05-17 10:03:00.880759493',
                     '2022-05-17 10:04:26.918101265',
                     '2022-05-17 10:05:53.443717948',
                     '2022-05-17 10:07:19.483846153',
                     '2022-05-17 10:08:51.280384615',
                     '2022-05-17 10:10:18.800129870',
                     '2022-05-17 10:11:44.335217949',
                     '2022-05-17 10:13:09.879831166',
                     '2022-05-17 10:14:35.415999993',
                     '2022-05-17 10:16:00.958662340',
                     '2022-05-17 10:17:26.000480516',
                     '2022-05-17 10:18:51.040480510',
                     '2022-05-17 10:20:16.576000003',
                     '2022-05-17 10:21:41.613307693',
                     '2022-05-17 10:23:07.645871786',
                     '2022-05-17 10:24:33.182886075',
                     '2022-05-17 10:26:05.461358974',
                     '2022-05-17 10:27:31.496230769',
                     '2022-05-17 10:28:57.029662337',
                     '2022-05-17 10:30:22.080831168',
                     '2022-05-17 10:31:47.616230769',
                     '2022-05-17 10:33:13.646615384',
                     '2022-05-17 10:34:39.686358974',
                     '2022-05-17 10:36:05.727000004',
                     '2022-05-17 10:37:31.261481008',
                     '2022-05-17 10:38:57.786205131',
                     '2022-05-17 10:40:23.321831176',
                     '2022-05-17 10:41:47.865307693',
                     '2022-05-17 10:43:19.652743591',
                     '2022-05-17 10:44:45.691717948',
                     '2022-05-17 10:46:11.727615384',
                     '2022-05-17 10:47:37.768358974',
                     '2022-05-17 10:49:02.806307692',
                     '2022-05-17 10:50:28.838871794',
                     '2022-05-17 10:51:53.877717948',
                     '2022-05-17 10:53:19.907076923',
                     '2022-05-17 10:54:45.441721518',
                     '2022-05-17 10:56:11.471662337',
                     '2022-05-17 10:57:36.511662337',
                     '2022-05-17 10:59:02.047807698',
                     '2022-05-17 11:00:33.718896101'],
                    dtype='datetime64[ns]', name='mean_time', freq=None))
In [10]:
# plotting wind speed and direction
plt.figure(figsize=(10,6))
wind_ds.horizontal_wind_speed.where(wind_ds.nan_percentual<50).plot(y="range", cmap="turbo", vmin=0, vmax=20)
plt.show()

plt.figure(figsize=(10,6))
wind_ds.horizontal_wind_direction.where(wind_ds.nan_percentual<50).plot(y="range", cmap="hsv", vmin=0, vmax=360)
plt.show()
No description has been provided for this image
No description has been provided for this image
In [11]:
# plotting the maximum ZDR from each scan
plt.figure(figsize=(10,6))
wind_ds.zdr_max.where(wind_ds.nan_percentual<50).plot(y="range", cmap="turbo", vmin=0, vmax=7)
plt.show()
No description has been provided for this image

In this last cell, you can save the retrieved wind data as a NetCDF file. To do it, you just need to uncomment the line below.

In [12]:
# wind_ds=to_netcdf('retrieved_wind.nc')
In [12]: