# Quick-view a RHI sweep in polar or cartesian reference systems¶

[ ]:

import numpy as np
import matplotlib.pyplot as pl
import warnings
warnings.filterwarnings('ignore')
try:
get_ipython().magic("matplotlib inline")
except:
pl.ion()


## Read a RHI polar data set from University Bonn XBand radar¶

[ ]:

filename = wrl.util.get_wradlib_data_file('hdf5/2014-06-09--185000.rhi.mvol')
img = data1['SCAN0']['ZH']['data']
# mask data array for better presentation



Inspect the data set a little

[ ]:

print("Shape of polar array: %r\n" % (img.shape,))
print("Some meta data of the RHI file:")


## The simplest way to plot this dataset¶

[ ]:

ax, pm = wrl.vis.plot_rhi(img)
txt = pl.title('Simple RHI - Rays/Bins')

[ ]:

ax, pm = wrl.vis.plot_rhi(img)
ax.set_ylim(0, 200)
txt = pl.title('Simple RHI - Rays/Bins - with ylimits')

[ ]:

ax, pm = wrl.vis.plot_rhi(img, r=r, th=th)
ax.set_ylim(0, 15000)
txt = pl.title('Simple RHI - Range vs. Height')

[ ]:

ax, pm = wrl.vis.plot_rhi(img, r=r, th=th, rf=1e3)
ax.set_ylim(0, 15)
txt = pl.title('Simple RHI - Range vs. Height (km)')


## More decorations and annotations¶

You can annotate these plots by using standard matplotlib methods.

[ ]:

ax, pm = wrl.vis.plot_rhi(img, r=r, th=th, rf=1e3)
ylabel = ax.set_xlabel('Ground Range [km]')
ylabel = ax.set_ylabel('Height [km]')
title = ax.set_title('RHI manipulations/colorbar')
# you can now also zoom - either programmatically or interactively
xlim = ax.set_xlim(25, 40)
ylim = ax.set_ylim(0, 15)
# as the function returns the axes- and 'mappable'-objects colorbar needs, adding a colorbar is easy
cb = pl.colorbar(pm, ax=ax)