towerpy.datavis.rad_interactive#
Towerpy: an open-source toolbox for processing polarimetric radar data.
Classes#
Functions#
|
Format the coordinates used in plots. |
|
Create the base display for the interactive PPI explorer. |
|
Create the base display for the HTI. |
|
Create an interactive plot for the ml_detection function. |
Module Contents#
- towerpy.datavis.rad_interactive.format_coord(x, y)[source]#
Format the coordinates used in plots.
Parameters#
- xfloat
x-coordinates.
- yfloat
y-coordinates.
Returns#
- z: str
Value of a given pixel.
- [q, r]list
angle and range of a given pixel.
- class towerpy.datavis.rad_interactive.PPI_Int[source]#
A class to create an interactive PPI plot.
- on_pick(event)[source]#
Get the click locations.
Parameters#
- eventMouse click
Right or left click from the mouse.
- on_press(event)[source]#
Browse through the next and previous azimuth.
Parameters#
- eventkey-press, ‘n’ or ‘m’
Keyboard event.
- towerpy.datavis.rad_interactive.ppi_base(rad_georef, rad_params, rad_vars, var2plot=None, coord_sys='polar', mlyr=None, vars_bounds=None, ucmap=None, unorm=None, cbticks=None, cb_ext=None, ppi_xlims=None, ppi_ylims=None, radial_xlims=None, radial_ylims=None, fig_size=None)[source]#
Create the base display for the interactive PPI explorer.
Parameters#
- rad_georefdict
Georeferenced data containing descriptors of the azimuth, gates and beam height, amongst others.
- rad_paramsdict
Radar technical details.
- rad_varsdict
Dict containing radar variables to plot.
- var2plotstr, optional
Key of the radar variable to plot. The default is None. This option will plot ZH or the ‘first’ element in the rad_vars dict.
- coord_sys‘rect’ or ‘polar’, optional
Coordinates system (polar or rectangular). The default is ‘polar’.
- mlyrMeltingLayer Class, optional
Plot the melting layer height. ml_top (float, int, list or np.array) and ml_bottom (float, int, list or np.array) must be explicitly defined. The default is None.
- vars_boundsdict containing key and 3-element tuple or list, optional
Boundaries [min, max, nvals] between which radar variables are to be mapped.
- ucmapcolormap, optional
User-defined colormap, either a matplotlib.colors.ListedColormap, or string from matplotlib.colormaps.
- unormdict containing matplotlib.colors normalisation objects, optional
User-defined normalisation methods to map colormaps onto radar data. The default is None.
- cbticksdict, optional
Modifies the default ticks’ location (dict values) and labels (dict keys) in the colour bar.
- cb_extdict containing key and str, optional
The str modifies the end(s) for out-of-range values for a given key (radar variable). The str has to be one of ‘neither’, ‘both’, ‘min’ or ‘max’.
- ppi_xlims2-element tuple or list, optional
Set the x-axis view limits [min, max] in the PPI. The default is None.
- ppi_ylims2-element tuple or list, optional
Set the y-axis view limits [min, max] in the PPI. The default is None.
- radial_xlims2-element tuple or list, optional
Set the x-axis view limits [min, max] in the PPI. The default is None.
- radial_ylimsdict containing key and 2-element tuple or list, optional
Set the y-axis view limits [min, max] in the radial variables. Key must be in rad_vars dict. The default is None.
- fig_size2-element tuple or list, optional
Modify the default plot size.
- class towerpy.datavis.rad_interactive.HTI_Int[source]#
A class to create an interactive HTI plot.
- hzfunc(label)[source]#
Update the right panel of the interactive HTI plot.
Parameters#
- labelstr
Name of the radar variable.
- towerpy.datavis.rad_interactive.hti_base(pol_profs, mlyrs=None, stats=None, var2plot=None, ptype='pseudo', vars_bounds=None, contourl=None, ucmap=None, unorm=None, htixlim=None, htiylim=None, cbticks=None, cb_ext=None, fig_size=None, tz='Europe/London')[source]#
Create the base display for the HTI.
Parameters#
- pol_profslist
List of PolarimetricProfiles objects.
- mlyrslist, optional
List of MeltingLayer objects. The default is None.
- statsstr, optional
Profiles statistic to plot in the right panel of the HTI plot. The default is None.
- var2plotstr, optional
Key of the radar variable to plot. The default is None. This option will plot ZH or the ‘first’ element in the rad_vars dict.
- ptypestr, ‘pseudo’ or ‘fcontour’
Create a pseudocolor or filled contours plot. The default is ‘pseudo’.
- vars_boundsdict containing key and 3-element tuple or list, optional
Boundaries [min, max, nvals] between which radar variables are to be mapped.
- contourlstr, optional
Draw contour lines of the specified radar variable. The default is None.
- ucmapcolormap, optional
User-defined colormap, either a matplotlib.colors.ListedColormap, or string from matplotlib.colormaps.
- unormdict containing matplotlib.colors normalisation objects, optional
User-defined normalisation methods to map colormaps onto radar data. The default is None.
- htixlim2-element tuple or list of datetime objects, optional
Set the x-axis view limits [min, max]. The default is None.
- htiylim2-element tuple or list, optional
Set the y-axis view limits [min, max]. The default is None.
- cbticksdict, optional
Modifies the default ticks’ location (dict values) and labels (dict keys) in the colour bar.
- cb_extdict containing key and str, optional
The str modifies the end(s) for out-of-range values for a given key (radar variable). The str has to be one of ‘neither’, ‘both’, ‘min’ or ‘max’.
- fig_size2-element tuple or list, optional
Modify the default plot size.
- tzstr
Key/name of the radar data timezone. The given tz string is then retrieved from the ZoneInfo module. Default is ‘Europe/London’
Returns#
- radiowidget
A MPL radio button.