Investigate KDP and PhiDP through a Convective Core near SAIL#

Within this notebook, we explore how to visualize, and analyze dual-pol fields from the SAIL field campaign using Xradar

Imports#

import xradar as xd
import xarray as xr
import pyart
import hvplot.xarray
import matplotlib.pyplot as plt
import numpy as np
## You are using the Python ARM Radar Toolkit (Py-ART), an open source
## library for working with weather radar data. Py-ART is partly
## supported by the U.S. Department of Energy as part of the Atmospheric
## Radiation Measurement (ARM) Climate Research Facility, an Office of
## Science user facility.
##
## If you use this software to prepare a publication, please cite:
##
##     JJ Helmus and SM Collis, JORS 2016, doi: 10.5334/jors.119
<frozen importlib._bootstrap>:283: DeprecationWarning: the load_module() method is deprecated and slated for removal in Python 3.12; use exec_module() instead

Read the Data#

radar = xd.io.open_cfradial1_datatree('../../data/sample-radar/test-pol.nc', first_dim='auto')

Georeference the Dataset#

first_sweep = radar['sweep_0'].to_dataset()
geo_ds = xd.georeference.get_x_y_z(first_sweep)

Plot PPIs#

geo_ds.DBZ.plot(x='x', y='y', vmin=-20, vmax=60, cmap='pyart_HomeyerRainbow');
../_images/d7f313e84da9b338ab6f75991141d96c47c1ec0733cab1952a3b48f198638a03.png
geo_ds.DBZ.plot(x='x', y='y', vmin=-20, vmax=60, cmap='pyart_HomeyerRainbow')
<matplotlib.collections.QuadMesh at 0x298061150>
../_images/d7f313e84da9b338ab6f75991141d96c47c1ec0733cab1952a3b48f198638a03.png

Clean up the Azimuths#

geo_ds = geo_ds.drop_duplicates('azimuth')

Plot individual sectors#

We start first by slicing for the desired azimuths

sector = geo_ds.sel(azimuth=slice(329, 340))
sector.DBZ.plot(x='x',
                y='y',
                cmap='pyart_HomeyerRainbow',
                vmin=-20,
                vmax=60)
plt.xlim(-10_000, 0)
plt.ylim(0, 10_000)
(0.0, 10000.0)
../_images/ea91836dc2939cf27ea096a790aa79db8182cbdb16b310eca92481e9d16ddd9b.png
sector.KDP_LP.plot(x='x', y='y', cmap='pyart_Carbone42', vmin=0, vmax=4)
plt.xlim(-10_000, 0)
plt.ylim(0, 10_000)
(0.0, 10000.0)
../_images/ecfd32d0d1643d006259d4f094d09bf813d2bbcb62580652bfc24785b21dcd6a.png
sector.KDP_LP.plot.hist(bins = 40);
../_images/d048929116233662836a0a5d0dfa1645fc5a483488db462acf4079172d14a5bf.png
sector.KDP_maesaka.plot(x='x', y='y', cmap='pyart_Carbone42', vmin=0, vmax=4)
plt.xlim(-10_000, 0)
plt.ylim(0, 10_000)
(0.0, 10000.0)
../_images/4ce128f672575cef2613175b4e6ffa11585cd309173fb6d999c8cc16e43cdeaa.png

Select a single ray, using an azimuth#

azimuth_subset = geo_ds.sel(azimuth=336, method='nearest')
sector.DBZ.plot(x='x', y='y', cmap='pyart_HomeyerRainbow', vmin=-20, vmax=60)
plt.xlim(-10_000, 0)
plt.ylim(0, 10_000)
plt.plot(azimuth_subset.x, azimuth_subset.y, color='k')
[<matplotlib.lines.Line2D at 0x299c7cf40>]
../_images/66aed00d891eea04aa44dd2ed2df37fa08ae87f9137c9c0840f689938476d3e0.png
sector.KDP_LP.plot(x='x', y='y', cmap='pyart_Carbone42', vmin=0, vmax=4)
plt.xlim(-10_000, 0)
plt.ylim(0, 10_000)
plt.plot(azimuth_subset.x, azimuth_subset.y, color='k');
../_images/3c03a8d7881a9cdc71da5c1af49ea7c9e90fc9cb660409befb84b13d3539e4c4.png
fig = plt.figure()
ax = plt.subplot(111)
azimuth_subset.KDP_LP.plot(ax=ax,
                           color='tab:blue',
                           label='KDP')


ax2 = ax.twinx()
azimuth_subset.DBZ.plot(ax=ax2,
                        color='tab:red',
                        ylim=(-20, 60),
                        label='DBZ')
plt.legend();
../_images/7d9ef8be77cb912c1f514c52cc3dcfe8bc62996a1dbb968b7c3a0d5cc8c90380.png
fig = plt.figure()
ax = plt.subplot(111)
azimuth_subset.PHIDP.plot(ax=ax,
                          color='tab:blue',
                          ylim=(-180, 180),
                          label='KDP')


ax2 = ax.twinx()
azimuth_subset.PHIDP_UF.plot(ax=ax2,
                             ylim=(-180, 180),
                             color='tab:red',
                             label='Unfolded PHIDP')
plt.legend();
../_images/5ceee9f09601afc340da9544805a36fa0c03ef9c6c4810ab97c7928db5f471e6.png
fig = plt.figure()
ax = plt.subplot(111)
azimuth_subset.KDP_LP.plot(ax=ax,
                           color='tab:blue',
                           label='KDP')


ax2 = ax.twinx()
azimuth_subset.PHIDP_LP.plot(ax=ax2,
                             color='tab:red',
                             label='PHIDP')
plt.legend();
../_images/0282dd7c0fa3b05d5d18528762d6112ad7c1678d0369e2c750458d7b11928400.png
fig = plt.figure()
ax = plt.subplot(111)
azimuth_subset.KDP_LP.plot(ax=ax,
                           ylim=(-0.5, 3),
                           color='tab:blue',
                           label='KDP')


ax2 = ax.twinx()
azimuth_subset.KDP_maesaka.plot(ax=ax2,
                                ylim=(-0.5, 3),
                                color='tab:red',
                                label='KDP Maesaka')
plt.legend();
../_images/77aa98f2426c7a2b75a2c6a0eee9657c4c179ad638a1a95601a6887b319940f1.png