wradlib.vis.plot_rhi¶
-
wradlib.vis.plot_rhi(data, r=None, th=None, th_res=None, yoffset=0.0, autoext=True, refrac=True, rf=1.0, fig=None, ax=111, func='pcolormesh', cg=False, **kwargs)¶ Plots a Range Height Indicator (RHI).
The implementation of this plot routine is in cartesian axes and does all coordinate transforms beforehand. This allows zooming into the data as well as making it easier to plot additional data (like gauge locations) without having to convert them to the radar’s polar coordinate system.
Using
cg=Truethe plotting is done in a curvelinear grid axes. Additional data can be plotted in polar coordinates or cartesian coordinates depending which axes object is used.**kwargsmay be used to try to influence thematplotlib.pyplot.pcolormesh,matplotlib.pyplot.contourandmatplotlib.pyplot.contourfroutines under the hood.Parameters: - data (
numpy.ndarray) – The data to be plotted. It is assumed that the first dimension is over the elevation angles, while the second dimension is over the range bins - r (
numpy.ndarray) – The ranges. Units may be chosen arbitrarily. If None, a default is calculated from the dimensions ofdata. - rf (float) – If present, factor for scaling range axis, defaults to 1.
- th (
numpy.ndarray) – The elevation angles in degrees. If None, a default is calculated from the dimensions ofdata. - th_res (float or np.array of same shape as
th) – In RHI’s it happens that the elevation angles are spaced wider than the beam width. If this beam width (in degrees) is given inth_res, plot_rhi will plot the beams accordingly. Otherwise the behavior ofmatplotlib.pyplot.pcolormeshassumes all beams to be adjacent to each other, which might lead to unexpected results. - yoffset (float) – Altitude offset that would typically represent the altitude of
the radar antenna. Units must be consistent with units of
r. - autoext (bool) – This routine uses
matplotlib.pyplot.pcolormeshto draw the bins. As this function needs one set of coordinates more than would usually provided byrandaz, settingautoextto True automatically extendsrandazso that all ofdatawill be plotted. - refrac (bool) – If True, the effect of refractivity of the earth’s atmosphere on the
beam propagation will be taken into account. If False, simple
trigonometry will be used to calculate beam propagation.
Functionality for this will be provided by functions
wradlib.georef.misc.site_distanceandwradlib.georef.misc.bin_altitude, which assume distances to be given in meters. Therefore, ifrefracis True,rmust be given in meters. - fig (
matplotlib.figure.Figure) – If given, the RHI will be plotted into this figure object. Axes are created as needed. If None, a new figure object will be created or current figure will be used, depending onax. - ax (
matplotlib.axes.Axes| matplotlib grid definition) – If matplotlib Axes object is given, the RHI will be plotted into this axes object. If matplotlib grid definition is given (nrows/ncols/plotnumber), axis are created in the specified place. Defaults to ‘111’, only one subplot/axis. - func (str) – Name of plotting function to be used under the hood. Defaults to ‘pcolormesh’. ‘contour’ and ‘contourf’ can be selected too.
- cg (bool) – If True, the data will be plotted on curvelinear axes.
See also
wradlib.vis.create_cg- creation of curvelinear grid axes objects
Returns: - ax (
matplotlib.axes.Axes) – The axes object into which the RHI was plotted. - pm (
matplotlib.collections.QuadMesh|matplotlib.contour.QuadContourSet) – The result of the plotting function. Necessary, if you want to add a colorbar to the plot.
Note
If
cgis True, thecgax- curvelinear Axes (r-theta-grid) is returned.caax- Cartesian Axes (x-y-grid) andpaax- parasite axes object for plotting polar data can be derived like this:caax = cgax.parasites[0] paax = cgax.parasites[1]
The function
create_cguses the Matplotlib AXISARTIST namespace mpl_toolkits.axisartist.Here are some limitations to normal Matplotlib Axes. While using the Matplotlib AxesGrid Toolkit most of the limitations can be overcome. See Matplotlib AxesGrid Toolkit User’s Guide.
Examples
- data (