Quick-view a vertical cut (RHI)#
import datetime as dt
import matplotlib.pyplot as plt
Utility Functions#
import radarpolarimetry as rp
Load Single Sweep#
# choose radar specific parameters
start_time = dt.datetime(2017, 8, 10, 11, 0)
scan = "n_rhi_1"
swp = rp.load_single_sweep(
start_time,
scan,
reindex_angle=dict(start_angle=0, stop_angle=90, direction=1.0, angle_res=0.25),
)
display(swp)
<xarray.Dataset> Size: 46MB
Dimensions: (elevation: 360, range: 1333)
Coordinates: (12/15)
* elevation (elevation) float64 3kB 0.125 0.375 0.625 ... 89.62 89.88
azimuth (elevation) float64 3kB 256.0 256.0 256.0 ... 256.0 256.0
time (elevation) datetime64[ns] 3kB ...
* range (range) float32 5kB 37.5 112.5 ... 9.986e+04 9.994e+04
x (elevation, range) float64 4MB -36.38 -109.2 ... -209.1
y (elevation, range) float64 4MB -9.077 -27.23 ... -52.16
... ...
bins (elevation, range) float32 2MB 37.5 112.5 ... 9.994e+04
sweep_mode <U3 12B 'rhi'
longitude float64 8B 7.072
latitude float64 8B 50.73
altitude float64 8B 99.5
crs_wkt int64 8B 0
Data variables: (12/18)
DBZH (elevation, range) float32 2MB ...
DBZV (elevation, range) float32 2MB ...
KDP (elevation, range) float32 2MB ...
RHOHV (elevation, range) float32 2MB ...
CMAP (elevation, range) float32 2MB ...
DBTH (elevation, range) float32 2MB ...
... ...
PHIDP (elevation, range) float32 2MB ...
sweep_number int64 8B ...
prt_mode <U7 28B ...
follow_mode <U7 28B ...
sweep_fixed_angle float64 8B ...
nyquist_velocity float64 8B ...
Attributes:
source: gamic
ant_gain_h: 44.0
ant_gain_v: 44.0
noise_power_h: -0.52988
noise_power_v: -0.339564
rx_loss_h: 0.73
rx_loss_v: 0.73Plot reflectivity#
The simplest Plot#
pm = swp.DBZH.plot()
txt = plt.title("Simple Range-Elevation Plot")
Simplest RHI plot#
Using xarray wrl.vis-accessor RHI plots can be created.
pm = swp.DBZH.wrl.vis.plot()
txt = plt.title("Simple RHI Plot")
Zooming in using matplotlib#
pm = swp.DBZH.wrl.vis.plot()
txt = plt.title("Simple RHI Plot")
plt.gca().set_xlim(0, 60000)
plt.gca().set_ylim(0, 8000)
(0.0, 8000.0)
plot in curvelinear grid#
fig = plt.figure(figsize=(10, 3))
proj = {"angular_spacing": 20.0, "radial_spacing": 20.0, "latmin": 1000}
pm = swp.DBZH.wrl.vis.plot(fig=fig, crs=proj)
txt = plt.title("Simple RHI Plot", y=1.05)
plt.gca().set_ylim(0, 8000)
plt.gca().set_xlim(0, 50000)
(0.0, 50000.0)