forked from ARM-DOE/pyart
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplot_rhi_cfradial.py
executable file
·47 lines (36 loc) · 1.37 KB
/
plot_rhi_cfradial.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
"""
======================================================
Create a multiple panel RHI plot from a CF/Radial file
======================================================
An example which creates a multiple panel RHI plot of a CF/Radial file using
a RadarDisplay object.
"""
print __doc__
# Author: Jonathan J. Helmus ([email protected])
# License: BSD 3 clause
import netCDF4
import matplotlib.pyplot as plt
import pyart
filename = 'sgpxsaprrhicmacI5.c0.20110524.015604_NC4.nc'
# create the plot using RadarDisplay
radar = pyart.io.read_cfradial(filename)
radar.metadata['instrument_name'] = 'XSARP'
display = pyart.graph.RadarDisplay(radar)
fig = plt.figure(figsize=[12, 17])
fig.subplots_adjust(hspace=0.4)
xlabel = 'Distance from radar (km)'
ylabel = 'Height agl (km)'
colorbar_label = 'Hz. Eq. Refl. Fac. (dBZ)'
nplots = radar.nsweeps
for snum in radar.sweep_number['data']:
fixed_angle = radar.fixed_angle['data'][snum]
title = 'HSRHI Az=%.3f' % (fixed_angle)
ax = fig.add_subplot(nplots, 1, snum+1)
display.plot('reflectivity_horizontal', snum, vmin=-20, vmax=20,
mask_outside=False, title=title,
axislabels=(xlabel, ylabel),
colorbar_label=colorbar_label, ax=ax)
display.set_limits(ylim=[0, 15], ax=ax)
figure_title = 'Time: ' + display.time_begin.isoformat() + 'Z'
fig.text(0.35, 0.92, figure_title)
plt.show()