Graphing (pyart.graph)

Creating plots of Radar and Grid fields.

Plotting radar data

RadarDisplay(radar[, shift]) A display object for creating plots from data in a radar object.
RadarMapDisplay(radar[, shift, grid_projection]) A display object for creating plots on a geographic map from data in a Radar object.
AirborneRadarDisplay(radar[, shift]) A display object for creating plots from data in a airborne radar object.
RadarMapDisplayBasemap(radar[, shift]) A display object for creating plots on a geographic map from data in a Radar object.

Plotting grid data

GridMapDisplay(grid[, debug]) A class for creating plots from a grid object using xarray with a cartopy projection.
GridMapDisplayBasemap(grid[, debug]) A class for creating plots from a grid object on top of a Basemap.
class pyart.graph.AirborneRadarDisplay(radar, shift=(0.0, 0.0))[source]

Bases: pyart.graph.radardisplay.RadarDisplay

A display object for creating plots from data in a airborne radar object.

Parameters:
radar : Radar

Radar object to use for creating plots, should be an airborne radar.

shift : (float, float)

Shifts in km to offset the calculated x and y locations.

Attributes:
plots : list

List of plots created.

plot_vars : list

List of fields plotted, order matches plot list.

cbs : list

List of colorbars created.

origin : str

‘Origin’ or ‘Radar’.

shift : (float, float)

Shift in meters.

loc : (float, float)

Latitude and Longitude of radar in degrees.

fields : dict

Radar fields.

scan_type : str

Scan type.

ranges : array

Gate ranges in meters.

azimuths : array

Azimuth angle in degrees.

elevations : array

Elevations in degrees.

fixed_angle : array

Scan angle in degrees.

rotation : array

Rotation angle in degrees.

roll : array

Roll angle in degrees.

drift : array

Drift angle in degrees.

tilt : array

Tilt angle in degrees.

heading : array

Heading angle in degrees.

pitch : array

Pitch angle in degrees.

altitude : array

Altitude angle in meters.

Methods

generate_az_rhi_title(self, field, azimuth) Generate a title for a ray plot.
generate_filename(self, field, sweep[, ext, …]) Generate a filename for a plot.
generate_ray_title(self, field, ray) Generate a title for a ray plot.
generate_title(self, field, sweep[, …]) Generate a title for a plot.
generate_vpt_title(self, field) Generate a title for a VPT plot.
label_xaxis_r(self[, ax]) Label the xaxis with the default label for r units.
label_xaxis_rays([ax]) Label the yaxis with the default label for rays.
label_xaxis_time([ax]) Label the yaxis with the default label for rays.
label_xaxis_x(self[, ax]) Label the xaxis with the default label for x units.
label_yaxis_field(self, field[, ax]) Label the yaxis with the default label for a field units.
label_yaxis_y(self[, ax]) Label the yaxis with the default label for y units.
label_yaxis_z(self[, ax]) Label the yaxis with the default label for z units.
plot(self, field[, sweep]) Create a plot appropiate for the radar.
plot_azimuth_to_rhi(self, field, target_azimuth) Plot pseudo-RHI scan by extracting the vertical field associated with the given azimuth.
plot_colorbar(self[, mappable, field, …]) Plot a colorbar.
plot_cross_hair(size[, npts, ax]) Plot a cross-hair on a ppi plot.
plot_grid_lines([ax, col, ls]) Plot grid lines.
plot_label(self, label, location[, symbol, …]) Plot a single symbol and label at a given location.
plot_labels(self, labels, locations[, …]) Plot symbols and labels at given locations.
plot_ppi(self, field[, sweep, mask_tuple, …]) Plot a PPI.
plot_range_ring(range_ring_location_km[, …]) Plot a single range ring.
plot_range_rings(self, range_rings[, ax, …]) Plot a series of range rings.
plot_ray(self, field, ray[, format_str, …]) Plot a single ray.
plot_rhi(self, field[, sweep, mask_tuple, …]) Plot a RHI.
plot_sweep_grid(self, field[, sweep, …]) Plot a sweep as a grid.
plot_vpt(self, field[, mask_tuple, vmin, …]) Plot a VPT scan.
set_aspect_ratio([aspect_ratio, ax]) Set the aspect ratio for plot area.
set_limits([xlim, ylim, ax]) Set the display limits.
__class__

alias of builtins.type

__delattr__(self, name, /)

Implement delattr(self, name).

__dict__ = mappingproxy({'__module__': 'pyart.graph.radardisplay_airborne', '__doc__': "\n A display object for creating plots from data in a airborne radar object.\n\n Parameters\n ----------\n radar : Radar\n Radar object to use for creating plots, should be an airborne radar.\n shift : (float, float)\n Shifts in km to offset the calculated x and y locations.\n\n Attributes\n ----------\n plots : list\n List of plots created.\n plot_vars : list\n List of fields plotted, order matches plot list.\n cbs : list\n List of colorbars created.\n origin : str\n 'Origin' or 'Radar'.\n shift : (float, float)\n Shift in meters.\n loc : (float, float)\n Latitude and Longitude of radar in degrees.\n fields : dict\n Radar fields.\n scan_type : str\n Scan type.\n ranges : array\n Gate ranges in meters.\n azimuths : array\n Azimuth angle in degrees.\n elevations : array\n Elevations in degrees.\n fixed_angle : array\n Scan angle in degrees.\n rotation : array\n Rotation angle in degrees.\n roll : array\n Roll angle in degrees.\n drift : array\n Drift angle in degrees.\n tilt : array\n Tilt angle in degrees.\n heading : array\n Heading angle in degrees.\n pitch : array\n Pitch angle in degrees.\n altitude : array\n Altitude angle in meters.\n\n ", '__init__': <function AirborneRadarDisplay.__init__>, 'plot': <function AirborneRadarDisplay.plot>, 'plot_sweep_grid': <function AirborneRadarDisplay.plot_sweep_grid>, 'label_xaxis_x': <function AirborneRadarDisplay.label_xaxis_x>, 'label_yaxis_y': <function AirborneRadarDisplay.label_yaxis_y>, 'label_yaxis_z': <function AirborneRadarDisplay.label_yaxis_z>, '_get_x_z': <function AirborneRadarDisplay._get_x_z>, '_get_x_y_z': <function AirborneRadarDisplay._get_x_y_z>})
__dir__(self, /)

Default dir() implementation.

__eq__(self, value, /)

Return self==value.

__format__(self, format_spec, /)

Default object formatter.

__ge__(self, value, /)

Return self>=value.

__getattribute__(self, name, /)

Return getattr(self, name).

__gt__(self, value, /)

Return self>value.

__hash__(self, /)

Return hash(self).

__init__(self, radar, shift=(0.0, 0.0))[source]

Initialize the object.

__init_subclass__()

This method is called when a class is subclassed.

The default implementation does nothing. It may be overridden to extend subclasses.

__le__(self, value, /)

Return self<=value.

__lt__(self, value, /)

Return self<value.

__module__ = 'pyart.graph.radardisplay_airborne'
__ne__(self, value, /)

Return self!=value.

__new__(*args, **kwargs)

Create and return a new object. See help(type) for accurate signature.

__reduce__(self, /)

Helper for pickle.

__reduce_ex__(self, protocol, /)

Helper for pickle.

__repr__(self, /)

Return repr(self).

__setattr__(self, name, value, /)

Implement setattr(self, name, value).

__sizeof__(self, /)

Size of object in memory, in bytes.

__str__(self, /)

Return str(self).

__subclasshook__()

Abstract classes can override this to customize issubclass().

This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).

__weakref__

list of weak references to the object (if defined)

_get_azimuth_rhi_data_x_y_z(self, field, target_azimuth, edges, mask_tuple, filter_transitions, gatefilter)

Retrieve and return pseudo-RHI data from a plot function.

_get_colorbar_label(self, field)

Return a colorbar label for a given field.

_get_data(self, field, sweep, mask_tuple, filter_transitions, gatefilter)

Retrieve and return data from a plot function.

_get_ray_data(self, field, ray, mask_tuple, gatefilter)

Retrieve and return ray data from a plot function.

_get_vpt_data(self, field, mask_tuple, filter_transitions, gatefilter)

Retrieve and return vpt data from a plot function.

_get_x_y(self, sweep, edges, filter_transitions)

Retrieve and return x and y coordinate in km.

_get_x_y_z(self, sweep, edges, filter_transitions, ignoreTilt=False)[source]

Retrieve and return x, y, and z coordinate in km.

_get_x_z(self, sweep, edges, filter_transitions, ignoreTilt=False)[source]

Retrieve and return x and z coordinate in km.

_label_axes_ppi(self, axis_labels, ax)

Set the x and y axis labels for a PPI plot.

_label_axes_ray(self, axis_labels, field, ax)

Set the x and y axis labels for a ray plot.

_label_axes_rhi(self, axis_labels, ax)

Set the x and y axis labels for a RHI plot.

_label_axes_vpt(self, axis_labels, time_axis_flag, ax)

Set the x and y axis labels for a PPI plot.

_set_az_rhi_title(self, field, azimuth, title, ax)

Set the figure title for a ray plot using a default title.

_set_ray_title(self, field, ray, title, ax)

Set the figure title for a ray plot using a default title.

_set_title(self, field, sweep, title, ax, datetime_format=None, use_sweep_time=True)

Set the figure title using a default title.

static _set_vpt_time_axis(ax, date_time_form=None, tz=None)

Set the x axis as a time formatted axis.

Parameters:
ax : Matplotlib axis instance

Axis to plot. None will use the current axis.

date_time_form : str

Format of the time string for x-axis labels.

tz : str

Time zone info to use when creating axis labels (see datetime).

_set_vpt_title(self, field, title, ax)

Set the figure title using a default title.

generate_az_rhi_title(self, field, azimuth)

Generate a title for a ray plot.

Parameters:
field : str

Field plotted.

azimuth : float

Azimuth plotted.

Returns:
title : str

Plot title.

generate_filename(self, field, sweep, ext='png', datetime_format='%Y%m%d%H%M%S', use_sweep_time=False)

Generate a filename for a plot.

Generated filename has form:
radar_name_field_sweep_time.ext
Parameters:
field : str

Field plotted.

sweep : int

Sweep plotted.

ext : str

Filename extension.

datetime_format : str

Format of datetime (using strftime format).

use_sweep_time : bool

If true, the current sweep’s beginning time is used.

Returns:
filename : str

Filename suitable for saving a plot.

generate_ray_title(self, field, ray)

Generate a title for a ray plot.

Parameters:
field : str

Field plotted.

ray : int

Ray plotted.

Returns:
title : str

Plot title.

generate_title(self, field, sweep, datetime_format=None, use_sweep_time=True)

Generate a title for a plot.

Parameters:
field : str

Field plotted.

sweep : int

Sweep plotted.

datetime_format : str

Format of datetime (using strftime format).

use_sweep_time : bool

If true, the current sweep’s beginning time is used.

Returns:
title : str

Plot title.

generate_vpt_title(self, field)

Generate a title for a VPT plot.

Parameters:
field : str

Field plotted.

Returns:
title : str

Plot title.

label_xaxis_r(self, ax=None)

Label the xaxis with the default label for r units.

static label_xaxis_rays(ax=None)

Label the yaxis with the default label for rays.

static label_xaxis_time(ax=None)

Label the yaxis with the default label for rays.

label_xaxis_x(self, ax=None)[source]

Label the xaxis with the default label for x units.

label_yaxis_field(self, field, ax=None)

Label the yaxis with the default label for a field units.

label_yaxis_y(self, ax=None)[source]

Label the yaxis with the default label for y units.

label_yaxis_z(self, ax=None)[source]

Label the yaxis with the default label for z units.

plot(self, field, sweep=0, **kwargs)[source]

Create a plot appropiate for the radar.

This function calls the plotting function corresponding to the scan_type of the radar. Additional keywords can be passed to customize the plot, see the appropiate plot function for the allowed keywords.

Parameters:
field : str

Field to plot.

sweep : int

Sweep number to plot, not used for VPT scans.

See also

plot_ppi
Plot a PPI scan
plot_sweep_grid
Plot a RHI or VPT scan
plot_azimuth_to_rhi(self, field, target_azimuth, mask_tuple=None, vmin=None, vmax=None, norm=None, cmap=None, mask_outside=False, title=None, title_flag=True, axislabels=(None, None), axislabels_flag=True, colorbar_flag=True, colorbar_label=None, colorbar_orient='vertical', edges=True, gatefilter=None, reverse_xaxis=None, filter_transitions=True, ax=None, fig=None, ticks=None, ticklabs=None, raster=False, **kwargs)

Plot pseudo-RHI scan by extracting the vertical field associated with the given azimuth.

Additional arguments are passed to Matplotlib’s pcolormesh function.

Parameters:
field : str

Field to plot.

target_azimuth : integer

Azimuthal angle in degrees where cross section will be taken.

Other Parameters:
 
mask_tuple : (str, float)

2-Tuple containing the field name and value below which to mask field prior to plotting, for example to mask all data where NCP < 0.5 set mask to [‘NCP’, 0.5]. None performs no masking.

vmin : float

Luminance minimum value, None for default value. Parameter is ignored is norm is not None.

vmax : float

Luminance maximum value, None for default value. Parameter is ignored is norm is not None.

norm : Normalize or None, optional

matplotlib Normalize instance used to scale luminance data. If not None the vmax and vmin parameters are ignored. If None, vmin and vmax are used for luminance scaling.

cmap : str or None

Matplotlib colormap name. None will use the default colormap for the field being plotted as specified by the Py-ART configuration.

title : str

Title to label plot with, None to use default title generated from the field and sweep parameters. Parameter is ignored if title_flag is False.

title_flag : bool

True to add a title to the plot, False does not add a title.

axislabels : (str, str)

2-tuple of x-axis, y-axis labels. None for either label will use the default axis label. Parameter is ignored if axislabels_flag is False.

axislabels_flag : bool

True to add label the axes, False does not label the axes.

reverse_xaxis : bool or None

True to reverse the x-axis so the plot reads east to west, False to have east to west. None (the default) will reverse the axis only when all the distances are negative.

colorbar_flag : bool

True to add a colorbar with label to the axis. False leaves off the colorbar.

colorbar_label : str

Colorbar label, None will use a default label generated from the field information.

ticks : array

Colorbar custom tick label locations.

ticklabs : array

Colorbar custom tick labels.

colorbar_orient : ‘vertical’ or ‘horizontal’

Colorbar orientation.

edges : bool

True will interpolate and extrapolate the gate edges from the range, azimuth and elevations in the radar, treating these as specifying the center of each gate. False treats these coordinates themselves as the gate edges, resulting in a plot in which the last gate in each ray and the entire last ray are not not plotted.

gatefilter : GateFilter

GateFilter instance. None will result in no gatefilter mask being applied to data.

filter_transitions : bool

True to remove rays where the antenna was in transition between sweeps from the plot. False will include these rays in the plot. No rays are filtered when the antenna_transition attribute of the underlying radar is not present.

ax : Axis

Axis to plot on. None will use the current axis.

fig : Figure

Figure to add the colorbar to. None will use the current figure.

raster : bool

False by default. Set to True to render the display as a raster rather than a vector in call to pcolormesh. Saves time in plotting high resolution data over large areas. Be sure to set the dpi of the plot for your application if you save it as a vector format (i.e., pdf, eps, svg).

plot_colorbar(self, mappable=None, field=None, label=None, orient='vertical', cax=None, ax=None, fig=None, ticks=None, ticklabs=None)

Plot a colorbar.

Parameters:
mappable : Image, ContourSet, etc.

Image, ContourSet, etc to which the colorbar applied. If None the last mappable object will be used.

field : str

Field to label colorbar with.

label : str

Colorbar label. None will use a default value from the last field plotted.

orient : str

Colorbar orientation, either ‘vertical’ [default] or ‘horizontal’.

cax : Axis

Axis onto which the colorbar will be drawn. None is also valid.

ax : Axes

Axis onto which the colorbar will be drawn. None is also valid.

fig : Figure

Figure to place colorbar on. None will use the current figure.

ticks : array

Colorbar custom tick label locations.

ticklabs : array

Colorbar custom tick labels.

static plot_cross_hair(size, npts=100, ax=None)

Plot a cross-hair on a ppi plot.

Parameters:
size : float

Size of cross-hair in km.

npts: int

Number of points in the cross-hair, higher for better resolution.

ax : Axis

Axis to plot on. None will use the current axis.

static plot_grid_lines(ax=None, col='k', ls=':')

Plot grid lines.

Parameters:
ax : Axis

Axis to plot on. None will use the current axis.

col : str or value

Color to use for grid lines.

ls : str

Linestyle to use for grid lines.

plot_label(self, label, location, symbol='r+', text_color='k', ax=None)

Plot a single symbol and label at a given location.

Transforms of the symbol location in latitude and longitude units to x and y plot units is performed using an azimuthal equidistance map projection centered at the radar.

Parameters:
label : str

Label text to place just above symbol.

location : 2-tuples

Tuple of latitude, longitude (in degrees) at which the symbol will be place. The label is placed just above the symbol.

symbol : str

Matplotlib color+marker strings defining the symbol to place at the given location.

text_color : str

Matplotlib color defining the color of the label text.

ax : Axis

Axis to plot on. None will use the current axis.

plot_labels(self, labels, locations, symbols='r+', text_color='k', ax=None)

Plot symbols and labels at given locations.

Parameters:
labels : list of str

List of labels to place just above symbols.

locations : list of 2-tuples

List of latitude, longitude (in degrees) tuples at which symbols will be place. Labels are placed just above the symbols.

symbols : list of str or str

List of matplotlib color+marker strings defining symbols to place at given locations. If a single string is provided, that symbol will be placed at all locations.

text_color : str

Matplotlib color defining the color of the label text.

ax : Axis

Axis to plot on. None will use the current axis.

plot_ppi(self, field, sweep=0, mask_tuple=None, vmin=None, vmax=None, norm=None, cmap=None, mask_outside=False, title=None, title_flag=True, axislabels=(None, None), axislabels_flag=True, colorbar_flag=True, colorbar_label=None, colorbar_orient='vertical', edges=True, gatefilter=None, filter_transitions=True, ax=None, fig=None, ticks=None, ticklabs=None, raster=False, title_datetime_format=None, title_use_sweep_time=True, **kwargs)

Plot a PPI.

Additional arguments are passed to Matplotlib’s pcolormesh function.

Parameters:
field : str

Field to plot.

sweep : int, optional

Sweep number to plot.

Other Parameters:
 
mask_tuple : (str, float)

Tuple containing the field name and value below which to mask field prior to plotting, for example to mask all data where NCP < 0.5 set mask_tuple to [‘NCP’, 0.5]. None performs no masking.

vmin : float

Luminance minimum value, None for default value. Parameter is ignored is norm is not None.

vmax : float

Luminance maximum value, None for default value. Parameter is ignored is norm is not None.

norm : Normalize or None, optional

matplotlib Normalize instance used to scale luminance data. If not None the vmax and vmin parameters are ignored. If None, vmin and vmax are used for luminance scaling.

cmap : str or None

Matplotlib colormap name. None will use the default colormap for the field being plotted as specified by the Py-ART configuration.

mask_outside : bool

True to mask data outside of vmin, vmax. False performs no masking.

title : str

Title to label plot with, None to use default title generated from the field and sweep parameters. Parameter is ignored if title_flag is False.

title_datetime_format : str

Format of datetime in the title (using strftime format).

title_use_sweep_time : bool

True for the current sweep’s beginning time to be used for the title. False for the radar’s beginning time.

title_flag : bool

True to add a title to the plot, False does not add a title.

axislabels : (str, str)

2-tuple of x-axis, y-axis labels. None for either label will use the default axis label. Parameter is ignored if axislabels_flag is False.

axislabels_flag : bool

True to add label the axes, False does not label the axes.

colorbar_flag : bool

True to add a colorbar with label to the axis. False leaves off the colorbar.

colorbar_label : str

Colorbar label, None will use a default label generated from the field information.

colorbar_orient : ‘vertical’ or ‘horizontal’

Colorbar orientation.

ticks : array

Colorbar custom tick label locations.

ticklabs : array

Colorbar custom tick labels.

edges : bool

True will interpolate and extrapolate the gate edges from the range, azimuth and elevations in the radar, treating these as specifying the center of each gate. False treats these coordinates themselves as the gate edges, resulting in a plot in which the last gate in each ray and the entire last ray are not plotted.

gatefilter : GateFilter

GateFilter instance. None will result in no gatefilter mask being applied to data.

filter_transitions : bool

True to remove rays where the antenna was in transition between sweeps from the plot. False will include these rays in the plot. No rays are filtered when the antenna_transition attribute of the underlying radar is not present.

ax : Axis

Axis to plot on. None will use the current axis.

fig : Figure

Figure to add the colorbar to. None will use the current figure.

raster : bool

False by default. Set to true to render the display as a raster rather than a vector in call to pcolormesh. Saves time in plotting high resolution data over large areas. Be sure to set the dpi of the plot for your application if you save it as a vector format (i.e., pdf, eps, svg).

static plot_range_ring(range_ring_location_km, npts=100, ax=None, col='k', ls='-', lw=2)

Plot a single range ring.

Parameters:
range_ring_location_km : float

Location of range ring in km.

npts: int

Number of points in the ring, higher for better resolution.

ax : Axis

Axis to plot on. None will use the current axis.

col : str or value

Color to use for range rings.

ls : str

Linestyle to use for range rings.

plot_range_rings(self, range_rings, ax=None, col='k', ls='-', lw=2)

Plot a series of range rings.

Parameters:
range_rings : list

List of locations in km to draw range rings.

ax : Axis

Axis to plot on. None will use the current axis.

col : str or value

Color to use for range rings.

ls : str

Linestyle to use for range rings.

plot_ray(self, field, ray, format_str='k-', mask_tuple=None, ray_min=None, ray_max=None, mask_outside=False, title=None, title_flag=True, axislabels=(None, None), gatefilter=None, axislabels_flag=True, ax=None, fig=None)

Plot a single ray.

Parameters:
field : str

Field to plot.

ray : int

Ray number to plot.

Other Parameters:
 
format_str : str

Format string defining the line style and marker.

mask_tuple : (str, float)

Tuple containing the field name and value below which to mask field prior to plotting, for example to mask all data where NCP < 0.5 set mask_tuple to [‘NCP’, 0.5]. None performs no masking.

ray_min : float

Minimum ray value, None for default value, ignored if mask_outside is False.

ray_max : float

Maximum ray value, None for default value, ignored if mask_outside is False.

mask_outside : bool

True to mask data outside of vmin, vmax. False performs no masking.

title : str

Title to label plot with, None to use default title generated from the field and ray parameters. Parameter is ignored if title_flag is False.

title_flag : bool

True to add a title to the plot, False does not add a title.

gatefilter : GateFilter

GateFilter instance. None will result in no gatefilter mask being applied to data.

axislabels : (str, str)

2-tuple of x-axis, y-axis labels. None for either label will use the default axis label. Parameter is ignored if axislabels_flag is False.

axislabels_flag : bool

True to add label the axes, False does not label the axes.

ax : Axis

Axis to plot on. None will use the current axis.

fig : Figure

Figure to add the colorbar to. None will use the current figure.

plot_rhi(self, field, sweep=0, mask_tuple=None, vmin=None, vmax=None, norm=None, cmap=None, mask_outside=False, title=None, title_flag=True, axislabels=(None, None), axislabels_flag=True, reverse_xaxis=None, colorbar_flag=True, colorbar_label=None, colorbar_orient='vertical', edges=True, gatefilter=None, filter_transitions=True, ax=None, fig=None, ticks=None, ticklabs=None, raster=False, title_datetime_format=None, title_use_sweep_time=True, **kwargs)

Plot a RHI.

Additional arguments are passed to Matplotlib’s pcolormesh function.

Parameters:
field : str

Field to plot.

sweep : int,

Sweep number to plot.

Other Parameters:
 
mask_tuple : (str, float)

2-Tuple containing the field name and value below which to mask field prior to plotting, for example to mask all data where NCP < 0.5 set mask to [‘NCP’, 0.5]. None performs no masking.

vmin : float

Luminance minimum value, None for default value. Parameter is ignored is norm is not None.

vmax : float

Luminance maximum value, None for default value. Parameter is ignored is norm is not None.

norm : Normalize or None, optional

matplotlib Normalize instance used to scale luminance data. If not None the vmax and vmin parameters are ignored. If None, vmin and vmax are used for luminance scaling.

cmap : str or None

Matplotlib colormap name. None will use the default colormap for the field being plotted as specified by the Py-ART configuration.

title : str

Title to label plot with, None to use default title generated from the field and sweep parameters. Parameter is ignored if title_flag is False.

title_datetime_format : str

Format of datetime in the title (using strftime format).

title_use_sweep_time : bool

True for the current sweep’s beginning time to be used for the title. False for the radar’s beginning time.

title_flag : bool

True to add a title to the plot, False does not add a title.

axislabels : (str, str)

2-tuple of x-axis, y-axis labels. None for either label will use the default axis label. Parameter is ignored if axislabels_flag is False.

axislabels_flag : bool

True to add label the axes, False does not label the axes.

reverse_xaxis : bool or None

True to reverse the x-axis so the plot reads west to east, False to have east to west. None (the default) will reverse the axis only when all the distances are negative. (i.e) axis will be absolute distance without taking into consideration the orientation

colorbar_flag : bool

True to add a colorbar with label to the axis. False leaves off the colorbar.

colorbar_label : str

Colorbar label, None will use a default label generated from the field information.

colorbar_orient : ‘vertical’ or ‘horizontal’

Colorbar orientation.

ticks : array

Colorbar custom tick label locations.

ticklabs : array

Colorbar custom tick labels.

edges : bool

True will interpolate and extrapolate the gate edges from the range, azimuth and elevations in the radar, treating these as specifying the center of each gate. False treats these coordinates themselves as the gate edges, resulting in a plot in which the last gate in each ray and the entire last ray are not not plotted.

gatefilter : GateFilter

GateFilter instance. None will result in no gatefilter mask being applied to data.

filter_transitions : bool

True to remove rays where the antenna was in transition between sweeps from the plot. False will include these rays in the plot. No rays are filtered when the antenna_transition attribute of the underlying radar is not present.

ax : Axis

Axis to plot on. None will use the current axis.

fig : Figure

Figure to add the colorbar to. None will use the current figure.

raster : bool

False by default. Set to true to render the display as a raster rather than a vector in call to pcolormesh. Saves time in plotting high resolution data over large areas. Be sure to set the dpi of the plot for your application if you save it as a vector format (i.e., pdf, eps, svg).

plot_sweep_grid(self, field, sweep=0, ignoreTilt=False, mask_tuple=None, vmin=None, vmax=None, cmap=None, norm=None, mask_outside=False, title=None, title_flag=True, axislabels=(None, None), axislabels_flag=True, colorbar_flag=True, colorbar_label=None, colorbar_orient='vertical', edges=True, filter_transitions=True, ax=None, fig=None, gatefilter=None, raster=False, ticks=None, ticklabs=None, **kwargs)[source]

Plot a sweep as a grid.

Additional arguments are passed to Matplotlib’s pcolormesh function.

Parameters:
field : str

Field to plot.

sweep : int, optional

Sweep number to plot.

Other Parameters:
 
ignoreTilt : bool

True to ignore tilt angle when running the antenna_to_cartesian_track_relative coordinate transformation (by setting tilt angle to 0), effectively plotting data relative to slant range (the same plotting method utilized by the NCAR soloii/3 software). False (default) plots relative to the aircraft longitudinal axis.

mask_tuple : (str, float)

Tuple containing the field name and value below which to mask field prior to plotting, for example to mask all data where NCP < 0.5 set mask_tuple to [‘NCP’, 0.5]. None performs no masking.

vmin : float

Luminance minimum value, None for default value. Parameter is ignored is norm is not None.

vmax : float

Luminance maximum value, None for default value. Parameter is ignored is norm is not None.

norm : Normalize or None, optional

matplotlib Normalize instance used to scale luminance data. If not None the vmax and vmin parameters are ignored. If None, vmin and vmax are used for luminance scaling.

cmap : str or None

Matplotlib colormap name. None will use the default colormap for the field being plotted as specified by the Py-ART configuration.

mask_outside : bool

True to mask data outside of vmin, vmax. False performs no masking.

title : str

Title to label plot with, None to use default title generated from the field and sweep parameters. Parameter is ignored if title_flag is False.

title_flag : bool

True to add a title to the plot, False does not add a title.

axislabels : (str, str)

2-tuple of x-axis, y-axis labels. None for either label will use the default axis label. Parameter is ignored if axislabels_flag is False.

axislabels_flag : bool

True to add label the axes, False does not label the axes.

colorbar_flag : bool

True to add a colorbar with label to the axis. False leaves off the colorbar.

colorbar_label : str

Colorbar label, None will use a default label generated from the field information.

colorbar_orient : ‘vertical’ or ‘horizontal’

Colorbar orientation.

edges : bool

True will interpolate and extrapolate the gate edges from the range, azimuth and elevations in the radar, treating these as specifying the center of each gate. False treats these coordinates themselved as the gate edges, resulting in a plot in which the last gate in each ray and the entire last ray are not plotted.

gatefilter : GateFilter

GateFilter instance. None will result in no gatefilter mask being applied to data.

filter_transitions : bool

True to remove rays where the antenna was in transition between sweeps from the plot. False will include these rays in the plot. No rays are filtered when the antenna_transition attribute of the underlying radar is not present.

ax : Axis

Axis to plot on. None will use the current axis.

fig : Figure

Figure to add the colorbar to. None will use the current figure.

raster : bool

False by default. Set to true to render the display as a raster rather than a vector in call to pcolormesh. Saves time in plotting high resolution data over large areas. Be sure to set the dpi of the plot for your application if you save it as a vector format (i.e., pdf, eps, svg).

ticks : array

Colorbar custom tick label locations.

ticklabs : array

Colorbar custom tick labels.

plot_vpt(self, field, mask_tuple=None, vmin=None, vmax=None, norm=None, cmap=None, mask_outside=False, title=None, title_flag=True, axislabels=(None, None), axislabels_flag=True, colorbar_flag=True, colorbar_label=None, colorbar_orient='vertical', edges=True, gatefilter=None, filter_transitions=True, time_axis_flag=False, date_time_form=None, tz=None, ax=None, fig=None, ticks=None, ticklabs=None, raster=False, **kwargs)

Plot a VPT scan.

Additional arguments are passed to Matplotlib’s pcolormesh function.

Parameters:
field : str

Field to plot.

Other Parameters:
 
mask_tuple : (str, float)

Tuple containing the field name and value below which to mask field prior to plotting, for example to mask all data where NCP < 0.5 set mask_tuple to [‘NCP’, 0.5]. None performs no masking.

vmin : float

Luminance minimum value, None for default value. Parameter is ignored is norm is not None.

vmax : float

Luminance maximum value, None for default value. Parameter is ignored is norm is not None.

norm : Normalize or None, optional

matplotlib Normalize instance used to scale luminance data. If not None the vmax and vmin parameters are ignored. If None, vmin and vmax are used for luminance scaling.

cmap : str or None

Matplotlib colormap name. None will use the default colormap for the field being plotted as specified by the Py-ART configuration.

mask_outside : bool

True to mask data outside of vmin, vmax. False performs no masking.

title : str

Title to label plot with, None to use default title generated from the field and sweep parameters. Parameter is ignored if title_flag is False.

title_flag : bool

True to add a title to the plot, False does not add a title.

axislabels : (str, str)

2-tuple of x-axis, y-axis labels. None for either label will use the default axis label. Parameter is ignored if axislabels_flag is False.

axislabels_flag : bool

True to add label the axes, False does not label the axes.

colorbar_flag : bool

True to add a colorbar with label to the axis. False leaves off the colorbar.

colorbar_label : str

Colorbar label, None will use a default label generated from the field information.

ticks : array

Colorbar custom tick label locations.

ticklabs : array

Colorbar custom tick labels.

colorbar_orient : ‘vertical’ or ‘horizontal’

Colorbar orientation.

edges : bool

True will interpolate and extrapolate the gate edges from the range, azimuth and elevations in the radar, treating these as specifying the center of each gate. False treats these coordinates themselves as the gate edges, resulting in a plot in which the last gate in each ray and the entire last ray are not not plotted.

gatefilter : GateFilter

GateFilter instance. None will result in no gatefilter mask being applied to data.

filter_transitions : bool

True to remove rays where the antenna was in transition between sweeps from the plot. False will include these rays in the plot. No rays are filtered when the antenna_transition attribute of the underlying radar is not present.

time_axis_flag : bool

True to plot the x-axis as time. False uses the index number. Default is False - index-based.

date_time_form : str, optional

Format of the time string for x-axis labels. Parameter is ignored if time_axis_flag is set to False.

tz : str, optional

Time zone info to use when creating axis labels (see datetime). Parameter is ignored if time_axis_flag is set to False.

ax : Axis

Axis to plot on. None will use the current axis.

fig : Figure

Figure to add the colorbar to. None will use the current figure.

raster : bool

False by default. Set to true to render the display as a raster rather than a vector in call to pcolormesh. Saves time in plotting high resolution data over large areas. Be sure to set the dpi of the plot for your application if you save it as a vector format (i.e., pdf, eps, svg).

static set_aspect_ratio(aspect_ratio=0.75, ax=None)

Set the aspect ratio for plot area.

static set_limits(xlim=None, ylim=None, ax=None)

Set the display limits.

Parameters:
xlim : tuple, optional

2-Tuple containing y-axis limits in km. None uses default limits.

ylim : tuple, optional

2-Tuple containing x-axis limits in km. None uses default limits.

ax : Axis

Axis to adjust. None will adjust the current axis.

class pyart.graph.GridMapDisplay(grid, debug=False)[source]

Bases: object

A class for creating plots from a grid object using xarray with a cartopy projection.

Parameters:
grid : Grid

Grid with data which will be used to create plots.

debug : bool

True to print debugging messages, False to supress them.

Attributes:
grid : Grid

Grid object.

debug : bool

True to print debugging messages, False to supress them.

Methods

cartopy_coastlines(self) Get coastlines using cartopy.
cartopy_political_boundaries(self) Get political boundaries using cartopy.
cartopy_states(self) Get state boundaries using cartopy.
generate_filename(self, field, level[, ext]) Generate a filename for a grid plot.
generate_grid_title(self, field, level) Generate a title for a plot.
generate_latitudinal_level_title(self, …) Generate a title for a plot.
generate_longitudinal_level_title(self, …) Generate a title for a plot.
get_dataset(self) Creating an xarray dataset from a radar object.
plot_colorbar(self[, mappable, orientation, …]) Plot a colorbar.
plot_crosshairs(self[, lon, lat, linestyle, …]) Plot crosshairs at a given longitude and latitude.
plot_grid(self, field[, level, vmin, vmax, …]) Plot the grid using xarray and cartopy.
plot_grid_contour(self, field[, level, …]) Plot the grid contour using xarray and cartopy.
plot_latitude_slice(self, field[, lon, lat]) Plot a slice along a given latitude.
plot_latitudinal_level(self, field, y_index) Plot a slice along a given latitude.
plot_latlon_level(self, field, ind_1, ind_2) Plot a slice along two points given by its lat, lon Additional arguments are passed to Basemaps’s pcolormesh function.
plot_latlon_slice(self, field[, coord1, coord2]) Plot a slice along a given longitude.
plot_longitude_slice(self, field[, lon, lat]) Plot a slice along a given longitude.
plot_longitudinal_level(self, field, x_index) Plot a slice along a given longitude.
__class__

alias of builtins.type

__delattr__(self, name, /)

Implement delattr(self, name).

__dict__ = mappingproxy({'__module__': 'pyart.graph.gridmapdisplay', '__doc__': '\n A class for creating plots from a grid object using xarray\n with a cartopy projection.\n\n Parameters\n ----------\n grid : Grid\n Grid with data which will be used to create plots.\n debug : bool\n True to print debugging messages, False to supress them.\n\n Attributes\n ----------\n grid : Grid\n Grid object.\n debug : bool\n True to print debugging messages, False to supress them.\n\n ', '__init__': <function GridMapDisplay.__init__>, 'get_dataset': <function GridMapDisplay.get_dataset>, 'plot_grid': <function GridMapDisplay.plot_grid>, 'plot_grid_contour': <function GridMapDisplay.plot_grid_contour>, 'plot_crosshairs': <function GridMapDisplay.plot_crosshairs>, 'plot_latitude_slice': <function GridMapDisplay.plot_latitude_slice>, 'plot_latitudinal_level': <function GridMapDisplay.plot_latitudinal_level>, 'plot_longitude_slice': <function GridMapDisplay.plot_longitude_slice>, 'plot_longitudinal_level': <function GridMapDisplay.plot_longitudinal_level>, 'plot_latlon_slice': <function GridMapDisplay.plot_latlon_slice>, 'plot_latlon_level': <function GridMapDisplay.plot_latlon_level>, 'plot_colorbar': <function GridMapDisplay.plot_colorbar>, '_find_nearest_grid_indices': <function GridMapDisplay._find_nearest_grid_indices>, '_get_label_x': <function GridMapDisplay._get_label_x>, '_get_label_y': <function GridMapDisplay._get_label_y>, '_get_label_z': <function GridMapDisplay._get_label_z>, '_label_axes_grid': <function GridMapDisplay._label_axes_grid>, '_label_axes_longitude': <function GridMapDisplay._label_axes_longitude>, '_label_axes_latitude': <function GridMapDisplay._label_axes_latitude>, '_label_axes_latlon': <function GridMapDisplay._label_axes_latlon>, 'generate_filename': <function GridMapDisplay.generate_filename>, 'generate_grid_title': <function GridMapDisplay.generate_grid_title>, 'generate_latitudinal_level_title': <function GridMapDisplay.generate_latitudinal_level_title>, 'generate_longitudinal_level_title': <function GridMapDisplay.generate_longitudinal_level_title>, 'cartopy_states': <function GridMapDisplay.cartopy_states>, 'cartopy_political_boundaries': <function GridMapDisplay.cartopy_political_boundaries>, 'cartopy_coastlines': <function GridMapDisplay.cartopy_coastlines>, '__dict__': <attribute '__dict__' of 'GridMapDisplay' objects>, '__weakref__': <attribute '__weakref__' of 'GridMapDisplay' objects>})
__dir__(self, /)

Default dir() implementation.

__eq__(self, value, /)

Return self==value.

__format__(self, format_spec, /)

Default object formatter.

__ge__(self, value, /)

Return self>=value.

__getattribute__(self, name, /)

Return getattr(self, name).

__gt__(self, value, /)

Return self>value.

__hash__(self, /)

Return hash(self).

__init__(self, grid, debug=False)[source]

initalize the object.

__init_subclass__()

This method is called when a class is subclassed.

The default implementation does nothing. It may be overridden to extend subclasses.

__le__(self, value, /)

Return self<=value.

__lt__(self, value, /)

Return self<value.

__module__ = 'pyart.graph.gridmapdisplay'
__ne__(self, value, /)

Return self!=value.

__new__(*args, **kwargs)

Create and return a new object. See help(type) for accurate signature.

__reduce__(self, /)

Helper for pickle.

__reduce_ex__(self, protocol, /)

Helper for pickle.

__repr__(self, /)

Return repr(self).

__setattr__(self, name, value, /)

Implement setattr(self, name, value).

__sizeof__(self, /)

Size of object in memory, in bytes.

__str__(self, /)

Return str(self).

__subclasshook__()

Abstract classes can override this to customize issubclass().

This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).

__weakref__

list of weak references to the object (if defined)

_find_nearest_grid_indices(self, lon, lat)[source]

Find the nearest x, y grid indices for a given latitude and longitude.

_get_label_x(self)[source]

Get default label for x units.

_get_label_y(self)[source]

Get default label for y units.

_get_label_z(self)[source]

Get default label for z units.

_label_axes_grid(self, axis_labels, ax)[source]

Set the x and y axis labels for a grid plot.

_label_axes_latitude(self, axis_labels, ax)[source]

Set the x and y axis labels for a latitude slice.

_label_axes_latlon(self, axis_labels, ax)[source]

Set the x and y axis labels for a lat-lon slice.

_label_axes_longitude(self, axis_labels, ax)[source]

Set the x and y axis labels for a longitude slice.

cartopy_coastlines(self)[source]

Get coastlines using cartopy.

cartopy_political_boundaries(self)[source]

Get political boundaries using cartopy.

cartopy_states(self)[source]

Get state boundaries using cartopy.

generate_filename(self, field, level, ext='png')[source]

Generate a filename for a grid plot.

Generated filename has form:
grid_name_field_level_time.ext
Parameters:
field : str

Field plotted.

level : int

Level plotted.

ext : str

Filename extension.

Returns:
filename : str

Filename suitable for saving a plot.

generate_grid_title(self, field, level)[source]

Generate a title for a plot.

Parameters:
field : str

Field plotted.

level : int

Vertical level plotted.

Returns:
title : str

Plot title.

generate_latitudinal_level_title(self, field, level)[source]

Generate a title for a plot.

Parameters:
field : str

Field plotted.

level : int

Latitudinal level plotted.

Returns:
title : str

Plot title.

generate_longitudinal_level_title(self, field, level)[source]

Generate a title for a plot.

Parameters:
field : str

Field plotted.

level : int

Longitudinal level plotted.

Returns:
title : str

Plot title.

get_dataset(self)[source]

Creating an xarray dataset from a radar object. This function has been removed from Py-ART ARM-DOE

plot_colorbar(self, mappable=None, orientation='horizontal', label=None, cax=None, ax=None, fig=None, field=None, ticks=None, ticklabs=None)[source]

Plot a colorbar.

Parameters:
mappable : Image, ContourSet, etc.

Image, ContourSet, etc to which the colorbar applied. If None the last mappable object will be used.

field : str

Field to label colorbar with.

label : str

Colorbar label. None will use a default value from the last field plotted.

orient : str

Colorbar orientation, either ‘vertical’ [default] or ‘horizontal’.

cax : Axis

Axis onto which the colorbar will be drawn. None is also valid.

ax : Axes

Axis onto which the colorbar will be drawn. None is also valid.

fig : Figure

Figure to place colorbar on. None will use the current figure.

ticks : array

Colorbar custom tick label locations.

ticklabs : array

Colorbar custom tick labels.

plot_crosshairs(self, lon=None, lat=None, linestyle='--', color='r', linewidth=2, ax=None)[source]

Plot crosshairs at a given longitude and latitude.

Parameters:
lon, lat : float

Longitude and latitude (in degrees) where the crosshairs should be placed. If None the center of the grid is used.

linestyle : str

Matplotlib string describing the line style.

color : str

Matplotlib string for color of the line.

linewidth : float

Width of markers in points.

ax : axes or None

Axis to add the crosshairs to, if None the current axis is used.

plot_grid(self, field, level=0, vmin=None, vmax=None, norm=None, cmap=None, mask_outside=False, title=None, title_flag=True, axislabels=(None, None), axislabels_flag=False, colorbar_flag=True, colorbar_label=None, colorbar_orient='vertical', ax=None, fig=None, lat_lines=None, lon_lines=None, projection=None, embelish=True, maps_list=['countries', 'coastlines'], resolution='110m', alpha=None, background_zoom=8, ticks=None, ticklabs=None, imshow=False, **kwargs)[source]

Plot the grid using xarray and cartopy.

Additional arguments are passed to Xarray’s pcolormesh function.

Parameters:
field : str

Field to be plotted.

level : int

Index corresponding to the height level to be plotted.

Other Parameters:
 
vmin, vmax : float

Lower and upper range for the colormesh. If either parameter is None, a value will be determined from the field attributes (if available) or the default values of -8, 64 will be used. Parameters are used for luminance scaling.

norm : Normalize or None, optional

matplotlib Normalize instance used to scale luminance data. If not None the vmax and vmin parameters are ignored. If None, vmin and vmax are used for luminance scaling.

cmap : str or None

Matplotlib colormap name. None will use default colormap for the field being plotted as specified by the Py-ART configuration.

mask_outside : bool

True to mask data outside of vmin, vmax. False performs no masking.

title : str

Title to label plot with, None will use the default generated from the field and level parameters. Parameter is ignored if the title_flag is False.

title_flag : bool

True to add title to plot, False does not add a title.

axislabels : (str, str)

2-tuple of x-axis, y-axis labels. None for either label will use the default axis label. Parameter is ignored if axislabels_flag is False.

axislabels_flag : bool

True to add label the axes, False does not label the axes.

colorbar_flag : bool

True to add a colorbar with label to the axis. False leaves off the colorbar.

colorbar_label : str

Colorbar label, None will use a default label generated from the field information.

colorbar_orient : ‘vertical’ or ‘horizontal’

Colorbar orientation.

ax : Axis

Axis to plot on. None will use the current axis.

fig : Figure

Figure to add the colorbar to. None will use the current figure.

lat_lines, lon_lines : array or None

Location at which to draw latitude and longitude lines. None will use default values which are reasonable for maps of North America.

projection : cartopy.crs class

Map projection supported by cartopy. Used for all subsequent calls to the GeoAxes object generated. Defaults to PlateCarree.

embelish : bool

True by default. Set to False to supress drawinf of coastlines etc… Use for speedup when specifying shapefiles. Note that lat lon labels only work with certain projections.

maps_list: list of strings

if embelish is true the list of maps to use. default countries, coastlines

resolution : ‘10m’, ‘50m’, ‘110m’.

Resolution of NaturalEarthFeatures to use. See Cartopy documentation for details.

alpha : float or None

Set the alpha tranparency of the grid plot. Useful for overplotting radar over other datasets.

background_zoom : int

Zoom of the background image. A highest number provides more detail at the cost of processing speed

ticks : array

Colorbar custom tick label locations.

ticklabs : array

Colorbar custom tick labels.

imshow : bool

If used, plot uses ax.imshow instead of ax.pcolormesh. Default is False.

plot_grid_contour(self, field, level=0, vmin=None, vmax=None, mask_outside=False, title=None, title_flag=True, ax=None, fig=None, lat_lines=None, lon_lines=None, projection=None, contour_values=None, linewidths=1.5, embelish=True, maps_list=['countries', 'coastlines'], resolution='110m', background_zoom=8, **kwargs)[source]

Plot the grid contour using xarray and cartopy.

Additional arguments are passed to Xarray’s pcolormesh function.

Parameters:
field : str

Field to be plotted.

level : int

Index corresponding to the height level to be plotted.

Other Parameters:
 
vmin, vmax : float

Lower and upper range for the colormesh. If either parameter is None, a value will be determined from the field attributes (if available) or the default values of -8, 64 will be used. Parameters are used for luminance scaling.

mask_outside : bool

True to mask data outside of vmin, vmax. False performs no masking.

title : str

Title to label plot with, None will use the default generated from the field and level parameters. Parameter is ignored if the title_flag is False.

title_flag : bool

True to add title to plot, False does not add a title.

ax : Axis

Axis to plot on. None will use the current axis.

fig : Figure

Figure to add the colorbar to. None will use the current figure.

lat_lines, lon_lines : array or None

Location at which to draw latitude and longitude lines. None will use default values which are resonable for maps of North America.

projection : cartopy.crs class

Map projection supported by cartopy. Used for all subsequent calls to the GeoAxes object generated. Defaults to PlateCarree.

contour_values : float array

list of contours to plot

linewidths : float

width of the contour lines

embelish : bool

True by default. Set to False to supress drawinf of coastlines etc… Use for speedup when specifying shapefiles. Note that lat lon labels only work with certain projections.

maps_list: list of strings

if embelish is true the list of maps to use. default countries, coastlines

resolution : ‘10m’, ‘50m’, ‘110m’.

Resolution of NaturalEarthFeatures to use. See Cartopy documentation for details.

background_zoom : int

Zoom of the background image. A highest number provides more detail at the cost of processing speed

plot_latitude_slice(self, field, lon=None, lat=None, **kwargs)[source]

Plot a slice along a given latitude.

For documentation of additional arguments see plot_latitudinal_level().

Parameters:
field : str

Field to be plotted.

lon, lat : float

Longitude and latitude (in degrees) specifying the slice. If None the center of the grid is used.

plot_latitudinal_level(self, field, y_index, vmin=None, vmax=None, norm=None, cmap=None, mask_outside=False, title=None, title_flag=True, axislabels=(None, None), axislabels_flag=True, colorbar_flag=True, colorbar_label=None, colorbar_orient='vertical', edges=True, ax=None, fig=None, ticks=None, ticklabs=None, **kwargs)[source]

Plot a slice along a given latitude.

Additional arguments are passed to Basemaps’s pcolormesh function.

Parameters:
field : str

Field to be plotted.

y_index : float

Index of the latitudinal level to plot.

vmin, vmax : float

Lower and upper range for the colormesh. If either parameter is None, a value will be determined from the field attributes (if available) or the default values of -8, 64 will be used. Parameters are ignored is norm is not None.

norm : Normalize or None, optional

matplotlib Normalize instance used to scale luminance data. If not None the vmax and vmin parameters are ignored. If None, vmin and vmax are used for luminance scaling.

cmap : str or None

Matplotlib colormap name. None will use the default colormap for the field being plotted as specified by the Py-ART configuration.

mask_outside : bool

True to mask data outside of vmin, vmax. False performs no masking.

title : str

Title to label plot with, None to use default title generated from the field and lat,lon parameters. Parameter is ignored if title_flag is False.

title_flag : bool

True to add a title to the plot, False does not add a title.

axislabels : (str, str)

2-tuple of x-axis, y-axis labels. None for either label will use the default axis label. Parameter is ignored if axislabels_flag is False.

axislabels_flag : bool

True to add label the axes, False does not label the axes.

colorbar_flag : bool

True to add a colorbar with label to the axis. False leaves off the colorbar.

colorbar_label : str

Colorbar label, None will use a default label generated from the field information.

ticks : array

Colorbar custom tick label locations.

ticklabs : array

Colorbar custom tick labels.

colorbar_orient : ‘vertical’ or ‘horizontal’

Colorbar orientation.

edges : bool

True will interpolate and extrapolate the gate edges from the range, azimuth and elevations in the radar, treating these as specifying the center of each gate. False treats these coordinates themselved as the gate edges, resulting in a plot in which the last gate in each ray and the entire last ray are not not plotted.

ax : Axis

Axis to plot on. None will use the current axis.

fig : Figure

Figure to add the colorbar to. None will use the current figure.

ticks : array

Colorbar custom tick label locations.

ticklabs : array

Colorbar custom tick labels.

plot_latlon_level(self, field, ind_1, ind_2, vmin=None, vmax=None, norm=None, cmap=None, mask_outside=False, title=None, title_flag=True, axislabels=(None, None), axislabels_flag=True, colorbar_flag=True, colorbar_label=None, colorbar_orient='vertical', edges=True, ax=None, fig=None, ticks=None, ticklabs=None, **kwargs)[source]

Plot a slice along two points given by its lat, lon Additional arguments are passed to Basemaps’s pcolormesh function. Parameters ———- field : str

Field to be plotted.
ind_1, ind_2 : float
x,y indices of the two points crossed by the slice.
vmin, vmax : float
Lower and upper range for the colormesh. If either parameter is None, a value will be determined from the field attributes (if available) or the default values of -8, 64 will be used. Parameters are ignored is norm is not None.
norm : Normalize or None, optional
matplotlib Normalize instance used to scale luminance data. If not None the vmax and vmin parameters are ignored. If None, vmin and vmax are used for luminance scaling.
cmap : str or None
Matplotlib colormap name. None will use the default colormap for the field being plotted as specified by the Py-ART configuration.
mask_outside : bool
True to mask data outside of vmin, vmax. False performs no masking.
title : str
Title to label plot with, None to use default title generated from the field and lat,lon parameters. Parameter is ignored if title_flag is False.
title_flag : bool
True to add a title to the plot, False does not add a title.
axislabels : (str, str)
2-tuple of x-axis, y-axis labels. None for either label will use the default axis label. Parameter is ignored if axislabels_flag is False.
axislabels_flag : bool
True to add label the axes, False does not label the axes.
colorbar_flag : bool
True to add a colorbar with label to the axis. False leaves off the colorbar.
colorbar_label : str
Colorbar label, None will use a default label generated from the field information.
colorbar_orient : ‘vertical’ or ‘horizontal’
Colorbar orientation.
ticks : array
Colorbar custom tick label locations.
ticklabs : array
Colorbar custom tick labels.
edges : bool
True will interpolate and extrapolate the gate edges from the range, azimuth and elevations in the radar, treating these as specifying the center of each gate. False treats these coordinates themselved as the gate edges, resulting in a plot in which the last gate in each ray and the entire last ray are not not plotted.
ax : Axis
Axis to plot on. None will use the current axis.
fig : Figure
Figure to add the colorbar to. None will use the current figure.
plot_latlon_slice(self, field, coord1=None, coord2=None, **kwargs)[source]

Plot a slice along a given longitude. For documentation of additional arguments see plot_longitudinal_level(). Parameters ———- field : str

Field to be plotted.
coord1, coord2 : tupple of floats
tupple of floats containing the longitude and latitude (in degrees) specifying the two points crossed by the slice. If none two extremes of the grid is used
plot_longitude_slice(self, field, lon=None, lat=None, **kwargs)[source]

Plot a slice along a given longitude.

For documentation of additional arguments see plot_longitudinal_level().

Parameters:
field : str

Field to be plotted.

lon, lat : float

Longitude and latitude (in degrees) specifying the slice. If None the center of the grid is used.

plot_longitudinal_level(self, field, x_index, vmin=None, vmax=None, norm=None, cmap=None, mask_outside=False, title=None, title_flag=True, axislabels=(None, None), axislabels_flag=True, colorbar_flag=True, colorbar_label=None, colorbar_orient='vertical', edges=True, ax=None, fig=None, ticks=None, ticklabs=None, **kwargs)[source]

Plot a slice along a given longitude.

Additional arguments are passed to Basemaps’s pcolormesh function.

Parameters:
field : str

Field to be plotted.

x_index : float

Index of the longitudinal level to plot.

vmin, vmax : float

Lower and upper range for the colormesh. If either parameter is None, a value will be determined from the field attributes (if available) or the default values of -8, 64 will be used. Parameters are ignored is norm is not None.

norm : Normalize or None, optional

matplotlib Normalize instance used to scale luminance data. If not None the vmax and vmin parameters are ignored. If None, vmin and vmax are used for luminance scaling.

cmap : str or None

Matplotlib colormap name. None will use the default colormap for the field being plotted as specified by the Py-ART configuration.

mask_outside : bool

True to mask data outside of vmin, vmax. False performs no masking.

title : str

Title to label plot with, None to use default title generated from the field and lat,lon parameters. Parameter is ignored if title_flag is False.

title_flag : bool

True to add a title to the plot, False does not add a title.

axislabels : (str, str)

2-tuple of x-axis, y-axis labels. None for either label will use the default axis label. Parameter is ignored if axislabels_flag is False.

axislabels_flag : bool

True to add label the axes, False does not label the axes.

colorbar_flag : bool

True to add a colorbar with label to the axis. False leaves off the colorbar.

colorbar_label : str

Colorbar label, None will use a default label generated from the field information.

colorbar_orient : ‘vertical’ or ‘horizontal’

Colorbar orientation.

ticks : array

Colorbar custom tick label locations.

ticklabs : array

Colorbar custom tick labels.

edges : bool

True will interpolate and extrapolate the gate edges from the range, azimuth and elevations in the radar, treating these as specifying the center of each gate. False treats these coordinates themselved as the gate edges, resulting in a plot in which the last gate in each ray and the entire last ray are not not plotted.

ax : Axis

Axis to plot on. None will use the current axis.

fig : Figure

Figure to add the colorbar to. None will use the current figure.

class pyart.graph.GridMapDisplayBasemap(grid, debug=False)[source]

Bases: object

A class for creating plots from a grid object on top of a Basemap.

Parameters:
grid : Grid

Grid with data which will be used to create plots.

debug : bool

True to print debugging messages, False to supress them.

Attributes:
grid : Grid

Grid object.

debug : bool

True to print debugging messages, False to supressed them.

basemap : Basemap

Last plotted basemap, None when no basemap has been plotted.

mappables : list

List of ContourSet, etc. which have been plotted, useful when adding colorbars.

fields : list

List of fields which have been plotted.

Methods

generate_filename(self, field, level[, ext]) Generate a filename for a grid plot.
generate_grid_title(self, field, level) Generate a title for a plot.
generate_latitudinal_level_title(self, …) Generate a title for a plot.
generate_longitudinal_level_title(self, …) Generate a title for a plot.
get_basemap(self) get basemap of the plot
plot_basemap(self[, lat_lines, lon_lines, …]) Plot a basemap.
plot_colorbar(self[, mappable, orientation, …]) Plot a colorbar.
plot_crosshairs(self[, lon, lat, …]) Plot crosshairs at a given longitude and latitude.
plot_grid(self, field[, level, vmin, vmax, …]) Plot the grid onto the current basemap.
plot_latitude_slice(self, field[, lon, lat]) Plot a slice along a given latitude.
plot_latitudinal_level(self, field, y_index) Plot a slice along a given latitude.
plot_longitude_slice(self, field[, lon, lat]) Plot a slice along a given longitude.
plot_longitudinal_level(self, field, x_index) Plot a slice along a given longitude.
__class__

alias of builtins.type

__delattr__(self, name, /)

Implement delattr(self, name).

__dict__ = mappingproxy({'__module__': 'pyart.graph.gridmapdisplay_basemap', '__doc__': '\n A class for creating plots from a grid object on top of a Basemap.\n\n Parameters\n ----------\n grid : Grid\n Grid with data which will be used to create plots.\n debug : bool\n True to print debugging messages, False to supress them.\n\n Attributes\n ----------\n grid : Grid\n Grid object.\n debug : bool\n True to print debugging messages, False to supressed them.\n basemap : Basemap\n Last plotted basemap, None when no basemap has been plotted.\n mappables : list\n List of ContourSet, etc. which have been plotted, useful\n when adding colorbars.\n fields : list\n List of fields which have been plotted.\n\n ', '__init__': <function GridMapDisplayBasemap.__init__>, 'plot_basemap': <function GridMapDisplayBasemap.plot_basemap>, 'plot_grid': <function GridMapDisplayBasemap.plot_grid>, 'plot_crosshairs': <function GridMapDisplayBasemap.plot_crosshairs>, 'plot_latitude_slice': <function GridMapDisplayBasemap.plot_latitude_slice>, 'plot_latitudinal_level': <function GridMapDisplayBasemap.plot_latitudinal_level>, 'plot_longitude_slice': <function GridMapDisplayBasemap.plot_longitude_slice>, 'plot_longitudinal_level': <function GridMapDisplayBasemap.plot_longitudinal_level>, 'plot_colorbar': <function GridMapDisplayBasemap.plot_colorbar>, '_make_basemap': <function GridMapDisplayBasemap._make_basemap>, '_find_nearest_grid_indices': <function GridMapDisplayBasemap._find_nearest_grid_indices>, '_get_label_x': <function GridMapDisplayBasemap._get_label_x>, '_get_label_y': <function GridMapDisplayBasemap._get_label_y>, '_get_label_z': <function GridMapDisplayBasemap._get_label_z>, '_label_axes_grid': <function GridMapDisplayBasemap._label_axes_grid>, '_label_axes_longitude': <function GridMapDisplayBasemap._label_axes_longitude>, '_label_axes_latitude': <function GridMapDisplayBasemap._label_axes_latitude>, 'generate_filename': <function GridMapDisplayBasemap.generate_filename>, 'generate_grid_title': <function GridMapDisplayBasemap.generate_grid_title>, 'generate_longitudinal_level_title': <function GridMapDisplayBasemap.generate_longitudinal_level_title>, 'generate_latitudinal_level_title': <function GridMapDisplayBasemap.generate_latitudinal_level_title>, 'get_basemap': <function GridMapDisplayBasemap.get_basemap>, '__dict__': <attribute '__dict__' of 'GridMapDisplayBasemap' objects>, '__weakref__': <attribute '__weakref__' of 'GridMapDisplayBasemap' objects>})
__dir__(self, /)

Default dir() implementation.

__eq__(self, value, /)

Return self==value.

__format__(self, format_spec, /)

Default object formatter.

__ge__(self, value, /)

Return self>=value.

__getattribute__(self, name, /)

Return getattr(self, name).

__gt__(self, value, /)

Return self>value.

__hash__(self, /)

Return hash(self).

__init__(self, grid, debug=False)[source]

initalize the object.

__init_subclass__()

This method is called when a class is subclassed.

The default implementation does nothing. It may be overridden to extend subclasses.

__le__(self, value, /)

Return self<=value.

__lt__(self, value, /)

Return self<value.

__module__ = 'pyart.graph.gridmapdisplay_basemap'
__ne__(self, value, /)

Return self!=value.

__new__(*args, **kwargs)

Create and return a new object. See help(type) for accurate signature.

__reduce__(self, /)

Helper for pickle.

__reduce_ex__(self, protocol, /)

Helper for pickle.

__repr__(self, /)

Return repr(self).

__setattr__(self, name, value, /)

Implement setattr(self, name, value).

__sizeof__(self, /)

Size of object in memory, in bytes.

__str__(self, /)

Return str(self).

__subclasshook__()

Abstract classes can override this to customize issubclass().

This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).

__weakref__

list of weak references to the object (if defined)

_find_nearest_grid_indices(self, lon, lat)[source]

Find the nearest x, y grid indices for a given latitude and longitude.

_get_label_x(self)[source]

Get default label for x units.

_get_label_y(self)[source]

Get default label for y units.

_get_label_z(self)[source]

Get default label for z units.

_label_axes_grid(self, axis_labels, ax)[source]

Set the x and y axis labels for a grid plot.

_label_axes_latitude(self, axis_labels, ax)[source]

Set the x and y axis labels for a latitude slice.

_label_axes_longitude(self, axis_labels, ax)[source]

Set the x and y axis labels for a longitude slice.

_make_basemap(self, resolution='l', area_thresh=10000, auto_range=True, min_lon=-92, max_lon=-86, min_lat=40, max_lat=44, ax=None, **kwargs)[source]

Make a basemap.

Parameters:
auto_range : bool

True to determine map ranges from the latitude and longitude limits of the grid. False will use the min_lon, max_lon, min_lat, and max_lat parameters for the map range.

min_lat, max_lat, min_lon, max_lon : float

Latitude and longitude ranges for the map projection region in degrees. These parameter are not used if auto_range is True.

resolution : ‘c’, ‘l’, ‘i’, ‘h’, or ‘f’.

Resolution of boundary database to use. See Basemap documentation for details.

area_thresh : int

Basemap area_thresh parameter. See Basemap documentation.

ax : axes or None.

Axis to add the basemap to, if None the current axis is used.

kwargs : Basemap options

Options to be passed to Basemap. If projection is not specified here it uses proj=’merc’ (mercator).

generate_filename(self, field, level, ext='png')[source]

Generate a filename for a grid plot.

Generated filename has form:
grid_name_field_level_time.ext
Parameters:
field : str

Field plotted.

level : int

Level plotted.

ext : str

Filename extension.

Returns:
filename : str

Filename suitable for saving a plot.

generate_grid_title(self, field, level)[source]

Generate a title for a plot.

Parameters:
field : str

Field plotted.

level : int

Verical level plotted.

Returns:
title : str

Plot title.

generate_latitudinal_level_title(self, field, level)[source]

Generate a title for a plot.

Parameters:
field : str

Field plotted.

level : int

Longitudinal level plotted.

Returns:
title : str

Plot title.

generate_longitudinal_level_title(self, field, level)[source]

Generate a title for a plot.

Parameters:
field : str

Field plotted.

level : int

Longitudinal level plotted.

Returns:
title : str

Plot title.

get_basemap(self)[source]

get basemap of the plot

plot_basemap(self, lat_lines=None, lon_lines=None, resolution='l', area_thresh=10000, auto_range=True, min_lon=-92, max_lon=-86, min_lat=40, max_lat=44, ax=None, **kwargs)[source]

Plot a basemap.

Parameters:
lat_lines, lon_lines : array or None

Locations at which to draw latitude and longitude lines. None will use default values which are reasonable for maps of North America.

auto_range : bool

True to determine map ranges from the latitude and longitude limits of the grid. False will use the min_lon, max_lon, min_lat, and max_lat parameters for the map range.

min_lat, max_lat, min_lon, max_lon : float

Latitude and longitude ranges for the map projection region in degrees. These parameter are not used if auto_range is True.

resolution : ‘c’, ‘l’, ‘i’, ‘h’, or ‘f’.

Resolution of boundary database to use. See Basemap documentation for details.

area_thresh : int

Basemap area_thresh parameter. See Basemap documentation.

ax : axes or None.

Axis to add the basemap to, if None the current axis is used.

kwargs: Basemap options

Options to be passed to Basemap. If projection is not specified here it uses proj=’merc’ (mercator).

plot_colorbar(self, mappable=None, orientation='horizontal', label=None, cax=None, ax=None, fig=None, field=None, ticks=None, ticklabs=None)[source]

Plot a colorbar.

Parameters:
mappable : Image, ContourSet, etc.

Image, ContourSet, etc to which the colorbar applied. If None the last mappable object will be used.

field : str

Field to label colorbar with.

label : str

Colorbar label. None will use a default value from the last field plotted.

orient : str

Colorbar orientation, either ‘vertical’ [default] or ‘horizontal’.

cax : Axis

Axis onto which the colorbar will be drawn. None is also valid.

ax : Axes

Axis onto which the colorbar will be drawn. None is also valid.

fig : Figure

Figure to place colorbar on. None will use the current figure.

ticks : array

Colorbar custom tick label locations.

ticklabs : array

Colorbar custom tick labels.

plot_crosshairs(self, lon=None, lat=None, line_style='r--', linewidth=2, ax=None)[source]

Plot crosshairs at a given longitude and latitude.

Parameters:
lon, lat : float

Longitude and latitude (in degrees) where the crosshairs should be placed. If None the center of the grid is used.

line_style : str

Matplotlib string describing the line style.

linewidth : float

Width of markers in points.

ax : axes or None.

Axis to add the crosshairs to, if None the current axis is used.

plot_grid(self, field, level=0, vmin=None, vmax=None, norm=None, cmap=None, mask_outside=False, title=None, title_flag=True, axislabels=(None, None), axislabels_flag=False, colorbar_flag=True, colorbar_label=None, colorbar_orient='vertical', edges=True, ax=None, fig=None, ticks=None, ticklabs=None, **kwargs)[source]

Plot the grid onto the current basemap.

Additional arguments are passed to Basemaps’s pcolormesh function.

Parameters:
field : str

Field to be plotted.

level : int

Index corresponding to the height level to be plotted.

vmin, vmax : float

Lower and upper range for the colormesh. If either parameter is None, a value will be determined from the field attributes (if available) or the default values of -8, 64 will be used. Parameters are ignored is norm is not None.

norm : Normalize or None, optional

matplotlib Normalize instance used to scale luminance data. If not None the vmax and vmin parameters are ignored. If None, vmin and vmax are used for luminance scaling.

cmap : str or None

Matplotlib colormap name. None will use the default colormap for the field being plotted as specified by the Py-ART configuration.

mask_outside : bool

True to mask data outside of vmin, vmax. False performs no masking.

title : str

Title to label plot with, None to use default title generated from the field and level parameters. Parameter is ignored if title_flag is False.

title_flag : bool

True to add a title to the plot, False does not add a title.

axislabels : (str, str)

2-tuple of x-axis, y-axis labels. None for either label will use the default axis label. Parameter is ignored if axislabels_flag is False.

axislabels_flag : bool

True to add label the axes, False does not label the axes.

colorbar_flag : bool

True to add a colorbar with label to the axis. False leaves off the colorbar.

colorbar_label : str

Colorbar label, None will use a default label generated from the field information.

colorbar_orient : ‘vertical’ or ‘horizontal’

Colorbar orientation.

ticks : array

Colorbar custom tick label locations.

ticklabs : array

Colorbar custom tick labels.

edges : bool

True will interpolate and extrapolate the gate edges from the range, azimuth and elevations in the radar, treating these as specifying the center of each gate. False treats these coordinates themselved as the gate edges, resulting in a plot in which the last gate in each ray and the entire last ray are not not plotted.

ax : Axis

Axis to plot on. None will use the current axis.

fig : Figure

Figure to add the colorbar to. None will use the current figure.

ticks : array

Colorbar custom tick label locations.

ticklabs : array

Colorbar custom tick labels.

plot_latitude_slice(self, field, lon=None, lat=None, **kwargs)[source]

Plot a slice along a given latitude.

For documentation of additional arguments see plot_latitudinal_level().

Parameters:
field : str

Field to be plotted.

lon, lat : float

Longitude and latitude (in degrees) specifying the slice. If None the center of the grid is used.

plot_latitudinal_level(self, field, y_index, vmin=None, vmax=None, norm=None, cmap=None, mask_outside=False, title=None, title_flag=True, axislabels=(None, None), axislabels_flag=True, colorbar_flag=True, colorbar_label=None, colorbar_orient='vertical', edges=True, ax=None, fig=None, ticks=None, ticklabs=None, **kwargs)[source]

Plot a slice along a given latitude.

Additional arguments are passed to Basemaps’s pcolormesh function.

Parameters:
field : str

Field to be plotted.

y_index : float

Index of the latitudinal level to plot.

vmin, vmax : float

Lower and upper range for the colormesh. If either parameter is None, a value will be determined from the field attributes (if available) or the default values of -8, 64 will be used. Parameters are ignored is norm is not None.

norm : Normalize or None, optional

matplotlib Normalize instance used to scale luminance data. If not None the vmax and vmin parameters are ignored. If None, vmin and vmax are used for luminance scaling.

cmap : str or None

Matplotlib colormap name. None will use the default colormap for the field being plotted as specified by the Py-ART configuration.

mask_outside : bool

True to mask data outside of vmin, vmax. False performs no masking.

title : str

Title to label plot with, None to use default title generated from the field and lat,lon parameters. Parameter is ignored if title_flag is False.

title_flag : bool

True to add a title to the plot, False does not add a title.

axislabels : (str, str)

2-tuple of x-axis, y-axis labels. None for either label will use the default axis label. Parameter is ignored if axislabels_flag is False.

axislabels_flag : bool

True to add label the axes, False does not label the axes.

colorbar_flag : bool

True to add a colorbar with label to the axis. False leaves off the colorbar.

colorbar_label : str

Colorbar label, None will use a default label generated from the field information.

colorbar_orient : ‘vertical’ or ‘horizontal’

Colorbar orientation.

edges : bool

True will interpolate and extrapolate the gate edges from the range, azimuth and elevations in the radar, treating these as specifying the center of each gate. False treats these coordinates themselved as the gate edges, resulting in a plot in which the last gate in each ray and the entire last ray are not not plotted.

ax : Axis

Axis to plot on. None will use the current axis.

fig : Figure

Figure to add the colorbar to. None will use the current figure.

ticks : array

Colorbar custom tick label locations.

ticklabs : array

Colorbar custom tick labels.

plot_longitude_slice(self, field, lon=None, lat=None, **kwargs)[source]

Plot a slice along a given longitude.

For documentation of additional arguments see plot_longitudinal_level().

Parameters:
field : str

Field to be plotted.

lon, lat : float

Longitude and latitude (in degrees) specifying the slice. If None the center of the grid is used.

plot_longitudinal_level(self, field, x_index, vmin=None, vmax=None, norm=None, cmap=None, mask_outside=False, title=None, title_flag=True, axislabels=(None, None), axislabels_flag=True, colorbar_flag=True, colorbar_label=None, colorbar_orient='vertical', edges=True, ax=None, fig=None, ticks=None, ticklabs=None, **kwargs)[source]

Plot a slice along a given longitude.

Additional arguments are passed to Basemaps’s pcolormesh function.

Parameters:
field : str

Field to be plotted.

x_index : float

Index of the longitudinal level to plot.

vmin, vmax : float

Lower and upper range for the colormesh. If either parameter is None, a value will be determined from the field attributes (if available) or the default values of -8, 64 will be used. Parameters are ignored is norm is not None.

norm : Normalize or None, optional

matplotlib Normalize instance used to scale luminance data. If not None the vmax and vmin parameters are ignored. If None, vmin and vmax are used for luminance scaling.

cmap : str or None

Matplotlib colormap name. None will use the default colormap for the field being plotted as specified by the Py-ART configuration.

mask_outside : bool

True to mask data outside of vmin, vmax. False performs no masking.

title : str

Title to label plot with, None to use default title generated from the field and lat,lon parameters. Parameter is ignored if title_flag is False.

title_flag : bool

True to add a title to the plot, False does not add a title.

axislabels : (str, str)

2-tuple of x-axis, y-axis labels. None for either label will use the default axis label. Parameter is ignored if axislabels_flag is False.

axislabels_flag : bool

True to add label the axes, False does not label the axes.

colorbar_flag : bool

True to add a colorbar with label to the axis. False leaves off the colorbar.

colorbar_label : str

Colorbar label, None will use a default label generated from the field information.

colorbar_orient : ‘vertical’ or ‘horizontal’

Colorbar orientation.

edges : bool

True will interpolate and extrapolate the gate edges from the range, azimuth and elevations in the radar, treating these as specifying the center of each gate. False treats these coordinates themselved as the gate edges, resulting in a plot in which the last gate in each ray and the entire last ray are not not plotted.

ax : Axis

Axis to plot on. None will use the current axis.

fig : Figure

Figure to add the colorbar to. None will use the current figure.

ticks : array

Colorbar custom tick label locations.

ticklabs : array

Colorbar custom tick labels.

class pyart.graph.RadarDisplay(radar, shift=(0.0, 0.0))[source]

Bases: object

A display object for creating plots from data in a radar object.

Parameters:
radar : Radar

Radar object to use for creating plots.

shift : (float, float)

Shifts in km to offset the calculated x and y locations.

Attributes:
plots : list

List of plots created.

plot_vars : list

List of fields plotted, order matches plot list.

cbs : list

List of colorbars created.

origin : str

‘Origin’ or ‘Radar’.

shift : (float, float)

Shift in meters.

loc : (float, float)

Latitude and Longitude of radar in degrees.

fields : dict

Radar fields.

scan_type : str

Scan type.

ranges : array

Gate ranges in meters.

azimuths : array

Azimuth angle in degrees.

elevations : array

Elevations in degrees.

fixed_angle : array

Scan angle in degrees.

antenna_transition : array or None

Antenna transition flag (1 in transition, 0 in transition) or None if no antenna transition.

Methods

generate_az_rhi_title(self, field, azimuth) Generate a title for a ray plot.
generate_filename(self, field, sweep[, ext, …]) Generate a filename for a plot.
generate_ray_title(self, field, ray) Generate a title for a ray plot.
generate_title(self, field, sweep[, …]) Generate a title for a plot.
generate_vpt_title(self, field) Generate a title for a VPT plot.
label_xaxis_r(self[, ax]) Label the xaxis with the default label for r units.
label_xaxis_rays([ax]) Label the yaxis with the default label for rays.
label_xaxis_time([ax]) Label the yaxis with the default label for rays.
label_xaxis_x(self[, ax]) Label the xaxis with the default label for x units.
label_yaxis_field(self, field[, ax]) Label the yaxis with the default label for a field units.
label_yaxis_y(self[, ax]) Label the yaxis with the default label for y units.
label_yaxis_z(self[, ax]) Label the yaxis with the default label for z units.
plot(self, field[, sweep]) Create a plot appropiate for the radar.
plot_azimuth_to_rhi(self, field, target_azimuth) Plot pseudo-RHI scan by extracting the vertical field associated with the given azimuth.
plot_colorbar(self[, mappable, field, …]) Plot a colorbar.
plot_cross_hair(size[, npts, ax]) Plot a cross-hair on a ppi plot.
plot_grid_lines([ax, col, ls]) Plot grid lines.
plot_label(self, label, location[, symbol, …]) Plot a single symbol and label at a given location.
plot_labels(self, labels, locations[, …]) Plot symbols and labels at given locations.
plot_ppi(self, field[, sweep, mask_tuple, …]) Plot a PPI.
plot_range_ring(range_ring_location_km[, …]) Plot a single range ring.
plot_range_rings(self, range_rings[, ax, …]) Plot a series of range rings.
plot_ray(self, field, ray[, format_str, …]) Plot a single ray.
plot_rhi(self, field[, sweep, mask_tuple, …]) Plot a RHI.
plot_vpt(self, field[, mask_tuple, vmin, …]) Plot a VPT scan.
set_aspect_ratio([aspect_ratio, ax]) Set the aspect ratio for plot area.
set_limits([xlim, ylim, ax]) Set the display limits.
__class__

alias of builtins.type

__delattr__(self, name, /)

Implement delattr(self, name).

__dict__ = mappingproxy({'__module__': 'pyart.graph.radardisplay', '__doc__': "\n A display object for creating plots from data in a radar object.\n\n Parameters\n ----------\n radar : Radar\n Radar object to use for creating plots.\n shift : (float, float)\n Shifts in km to offset the calculated x and y locations.\n\n Attributes\n ----------\n plots : list\n List of plots created.\n plot_vars : list\n List of fields plotted, order matches plot list.\n cbs : list\n List of colorbars created.\n origin : str\n 'Origin' or 'Radar'.\n shift : (float, float)\n Shift in meters.\n loc : (float, float)\n Latitude and Longitude of radar in degrees.\n fields : dict\n Radar fields.\n scan_type : str\n Scan type.\n ranges : array\n Gate ranges in meters.\n azimuths : array\n Azimuth angle in degrees.\n elevations : array\n Elevations in degrees.\n fixed_angle : array\n Scan angle in degrees.\n antenna_transition : array or None\n Antenna transition flag (1 in transition, 0 in transition) or None\n if no antenna transition.\n\n ", '__init__': <function RadarDisplay.__init__>, 'plot': <function RadarDisplay.plot>, 'plot_ray': <function RadarDisplay.plot_ray>, 'plot_ppi': <function RadarDisplay.plot_ppi>, 'plot_rhi': <function RadarDisplay.plot_rhi>, 'plot_vpt': <function RadarDisplay.plot_vpt>, 'plot_azimuth_to_rhi': <function RadarDisplay.plot_azimuth_to_rhi>, 'plot_range_rings': <function RadarDisplay.plot_range_rings>, 'plot_range_ring': <staticmethod object>, 'plot_grid_lines': <staticmethod object>, 'plot_labels': <function RadarDisplay.plot_labels>, 'plot_label': <function RadarDisplay.plot_label>, 'plot_cross_hair': <staticmethod object>, 'plot_colorbar': <function RadarDisplay.plot_colorbar>, 'set_limits': <staticmethod object>, 'label_xaxis_x': <function RadarDisplay.label_xaxis_x>, 'label_yaxis_y': <function RadarDisplay.label_yaxis_y>, 'label_xaxis_r': <function RadarDisplay.label_xaxis_r>, 'label_yaxis_z': <function RadarDisplay.label_yaxis_z>, 'label_xaxis_rays': <staticmethod object>, 'label_xaxis_time': <staticmethod object>, 'label_yaxis_field': <function RadarDisplay.label_yaxis_field>, 'set_aspect_ratio': <staticmethod object>, '_set_title': <function RadarDisplay._set_title>, '_set_vpt_title': <function RadarDisplay._set_vpt_title>, '_set_ray_title': <function RadarDisplay._set_ray_title>, '_set_az_rhi_title': <function RadarDisplay._set_az_rhi_title>, '_label_axes_ppi': <function RadarDisplay._label_axes_ppi>, '_label_axes_rhi': <function RadarDisplay._label_axes_rhi>, '_label_axes_ray': <function RadarDisplay._label_axes_ray>, '_label_axes_vpt': <function RadarDisplay._label_axes_vpt>, '_set_vpt_time_axis': <staticmethod object>, 'generate_filename': <function RadarDisplay.generate_filename>, 'generate_title': <function RadarDisplay.generate_title>, 'generate_vpt_title': <function RadarDisplay.generate_vpt_title>, 'generate_ray_title': <function RadarDisplay.generate_ray_title>, 'generate_az_rhi_title': <function RadarDisplay.generate_az_rhi_title>, '_get_data': <function RadarDisplay._get_data>, '_get_vpt_data': <function RadarDisplay._get_vpt_data>, '_get_ray_data': <function RadarDisplay._get_ray_data>, '_get_azimuth_rhi_data_x_y_z': <function RadarDisplay._get_azimuth_rhi_data_x_y_z>, '_get_x_z': <function RadarDisplay._get_x_z>, '_get_x_y': <function RadarDisplay._get_x_y>, '_get_x_y_z': <function RadarDisplay._get_x_y_z>, '_get_colorbar_label': <function RadarDisplay._get_colorbar_label>, '__dict__': <attribute '__dict__' of 'RadarDisplay' objects>, '__weakref__': <attribute '__weakref__' of 'RadarDisplay' objects>})
__dir__(self, /)

Default dir() implementation.

__eq__(self, value, /)

Return self==value.

__format__(self, format_spec, /)

Default object formatter.

__ge__(self, value, /)

Return self>=value.

__getattribute__(self, name, /)

Return getattr(self, name).

__gt__(self, value, /)

Return self>value.

__hash__(self, /)

Return hash(self).

__init__(self, radar, shift=(0.0, 0.0))[source]

Initialize the object.

__init_subclass__()

This method is called when a class is subclassed.

The default implementation does nothing. It may be overridden to extend subclasses.

__le__(self, value, /)

Return self<=value.

__lt__(self, value, /)

Return self<value.

__module__ = 'pyart.graph.radardisplay'
__ne__(self, value, /)

Return self!=value.

__new__(*args, **kwargs)

Create and return a new object. See help(type) for accurate signature.

__reduce__(self, /)

Helper for pickle.

__reduce_ex__(self, protocol, /)

Helper for pickle.

__repr__(self, /)

Return repr(self).

__setattr__(self, name, value, /)

Implement setattr(self, name, value).

__sizeof__(self, /)

Size of object in memory, in bytes.

__str__(self, /)

Return str(self).

__subclasshook__()

Abstract classes can override this to customize issubclass().

This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).

__weakref__

list of weak references to the object (if defined)

_get_azimuth_rhi_data_x_y_z(self, field, target_azimuth, edges, mask_tuple, filter_transitions, gatefilter)[source]

Retrieve and return pseudo-RHI data from a plot function.

_get_colorbar_label(self, field)[source]

Return a colorbar label for a given field.

_get_data(self, field, sweep, mask_tuple, filter_transitions, gatefilter)[source]

Retrieve and return data from a plot function.

_get_ray_data(self, field, ray, mask_tuple, gatefilter)[source]

Retrieve and return ray data from a plot function.

_get_vpt_data(self, field, mask_tuple, filter_transitions, gatefilter)[source]

Retrieve and return vpt data from a plot function.

_get_x_y(self, sweep, edges, filter_transitions)[source]

Retrieve and return x and y coordinate in km.

_get_x_y_z(self, sweep, edges, filter_transitions)[source]

Retrieve and return x, y, and z coordinate in km.

_get_x_z(self, sweep, edges, filter_transitions)[source]

Retrieve and return x and z coordinate in km.

_label_axes_ppi(self, axis_labels, ax)[source]

Set the x and y axis labels for a PPI plot.

_label_axes_ray(self, axis_labels, field, ax)[source]

Set the x and y axis labels for a ray plot.

_label_axes_rhi(self, axis_labels, ax)[source]

Set the x and y axis labels for a RHI plot.

_label_axes_vpt(self, axis_labels, time_axis_flag, ax)[source]

Set the x and y axis labels for a PPI plot.

_set_az_rhi_title(self, field, azimuth, title, ax)[source]

Set the figure title for a ray plot using a default title.

_set_ray_title(self, field, ray, title, ax)[source]

Set the figure title for a ray plot using a default title.

_set_title(self, field, sweep, title, ax, datetime_format=None, use_sweep_time=True)[source]

Set the figure title using a default title.

static _set_vpt_time_axis(ax, date_time_form=None, tz=None)[source]

Set the x axis as a time formatted axis.

Parameters:
ax : Matplotlib axis instance

Axis to plot. None will use the current axis.

date_time_form : str

Format of the time string for x-axis labels.

tz : str

Time zone info to use when creating axis labels (see datetime).

_set_vpt_title(self, field, title, ax)[source]

Set the figure title using a default title.

generate_az_rhi_title(self, field, azimuth)[source]

Generate a title for a ray plot.

Parameters:
field : str

Field plotted.

azimuth : float

Azimuth plotted.

Returns:
title : str

Plot title.

generate_filename(self, field, sweep, ext='png', datetime_format='%Y%m%d%H%M%S', use_sweep_time=False)[source]

Generate a filename for a plot.

Generated filename has form:
radar_name_field_sweep_time.ext
Parameters:
field : str

Field plotted.

sweep : int

Sweep plotted.

ext : str

Filename extension.

datetime_format : str

Format of datetime (using strftime format).

use_sweep_time : bool

If true, the current sweep’s beginning time is used.

Returns:
filename : str

Filename suitable for saving a plot.

generate_ray_title(self, field, ray)[source]

Generate a title for a ray plot.

Parameters:
field : str

Field plotted.

ray : int

Ray plotted.

Returns:
title : str

Plot title.

generate_title(self, field, sweep, datetime_format=None, use_sweep_time=True)[source]

Generate a title for a plot.

Parameters:
field : str

Field plotted.

sweep : int

Sweep plotted.

datetime_format : str

Format of datetime (using strftime format).

use_sweep_time : bool

If true, the current sweep’s beginning time is used.

Returns:
title : str

Plot title.

generate_vpt_title(self, field)[source]

Generate a title for a VPT plot.

Parameters:
field : str

Field plotted.

Returns:
title : str

Plot title.

label_xaxis_r(self, ax=None)[source]

Label the xaxis with the default label for r units.

static label_xaxis_rays(ax=None)[source]

Label the yaxis with the default label for rays.

static label_xaxis_time(ax=None)[source]

Label the yaxis with the default label for rays.

label_xaxis_x(self, ax=None)[source]

Label the xaxis with the default label for x units.

label_yaxis_field(self, field, ax=None)[source]

Label the yaxis with the default label for a field units.

label_yaxis_y(self, ax=None)[source]

Label the yaxis with the default label for y units.

label_yaxis_z(self, ax=None)[source]

Label the yaxis with the default label for z units.

plot(self, field, sweep=0, **kwargs)[source]

Create a plot appropiate for the radar.

This function calls the plotting function corresponding to the scan_type of the radar. Additional keywords can be passed to customize the plot, see the appropiate plot function for the allowed keywords.

Parameters:
field : str

Field to plot.

sweep : int

Sweep number to plot, not used for VPT scans.

See also

plot_ppi
Plot a PPI scan
plot_rhi
Plot a RHI scan
plot_vpt
Plot a VPT scan
plot_azimuth_to_rhi(self, field, target_azimuth, mask_tuple=None, vmin=None, vmax=None, norm=None, cmap=None, mask_outside=False, title=None, title_flag=True, axislabels=(None, None), axislabels_flag=True, colorbar_flag=True, colorbar_label=None, colorbar_orient='vertical', edges=True, gatefilter=None, reverse_xaxis=None, filter_transitions=True, ax=None, fig=None, ticks=None, ticklabs=None, raster=False, **kwargs)[source]

Plot pseudo-RHI scan by extracting the vertical field associated with the given azimuth.

Additional arguments are passed to Matplotlib’s pcolormesh function.

Parameters:
field : str

Field to plot.

target_azimuth : integer

Azimuthal angle in degrees where cross section will be taken.

Other Parameters:
 
mask_tuple : (str, float)

2-Tuple containing the field name and value below which to mask field prior to plotting, for example to mask all data where NCP < 0.5 set mask to [‘NCP’, 0.5]. None performs no masking.

vmin : float

Luminance minimum value, None for default value. Parameter is ignored is norm is not None.

vmax : float

Luminance maximum value, None for default value. Parameter is ignored is norm is not None.

norm : Normalize or None, optional

matplotlib Normalize instance used to scale luminance data. If not None the vmax and vmin parameters are ignored. If None, vmin and vmax are used for luminance scaling.

cmap : str or None

Matplotlib colormap name. None will use the default colormap for the field being plotted as specified by the Py-ART configuration.

title : str

Title to label plot with, None to use default title generated from the field and sweep parameters. Parameter is ignored if title_flag is False.

title_flag : bool

True to add a title to the plot, False does not add a title.

axislabels : (str, str)

2-tuple of x-axis, y-axis labels. None for either label will use the default axis label. Parameter is ignored if axislabels_flag is False.

axislabels_flag : bool

True to add label the axes, False does not label the axes.

reverse_xaxis : bool or None

True to reverse the x-axis so the plot reads east to west, False to have east to west. None (the default) will reverse the axis only when all the distances are negative.

colorbar_flag : bool

True to add a colorbar with label to the axis. False leaves off the colorbar.

colorbar_label : str

Colorbar label, None will use a default label generated from the field information.

ticks : array

Colorbar custom tick label locations.

ticklabs : array

Colorbar custom tick labels.

colorbar_orient : ‘vertical’ or ‘horizontal’

Colorbar orientation.

edges : bool

True will interpolate and extrapolate the gate edges from the range, azimuth and elevations in the radar, treating these as specifying the center of each gate. False treats these coordinates themselves as the gate edges, resulting in a plot in which the last gate in each ray and the entire last ray are not not plotted.

gatefilter : GateFilter

GateFilter instance. None will result in no gatefilter mask being applied to data.

filter_transitions : bool

True to remove rays where the antenna was in transition between sweeps from the plot. False will include these rays in the plot. No rays are filtered when the antenna_transition attribute of the underlying radar is not present.

ax : Axis

Axis to plot on. None will use the current axis.

fig : Figure

Figure to add the colorbar to. None will use the current figure.

raster : bool

False by default. Set to True to render the display as a raster rather than a vector in call to pcolormesh. Saves time in plotting high resolution data over large areas. Be sure to set the dpi of the plot for your application if you save it as a vector format (i.e., pdf, eps, svg).

plot_colorbar(self, mappable=None, field=None, label=None, orient='vertical', cax=None, ax=None, fig=None, ticks=None, ticklabs=None)[source]

Plot a colorbar.

Parameters:
mappable : Image, ContourSet, etc.

Image, ContourSet, etc to which the colorbar applied. If None the last mappable object will be used.

field : str

Field to label colorbar with.

label : str

Colorbar label. None will use a default value from the last field plotted.

orient : str

Colorbar orientation, either ‘vertical’ [default] or ‘horizontal’.

cax : Axis

Axis onto which the colorbar will be drawn. None is also valid.

ax : Axes

Axis onto which the colorbar will be drawn. None is also valid.

fig : Figure

Figure to place colorbar on. None will use the current figure.

ticks : array

Colorbar custom tick label locations.

ticklabs : array

Colorbar custom tick labels.

static plot_cross_hair(size, npts=100, ax=None)[source]

Plot a cross-hair on a ppi plot.

Parameters:
size : float

Size of cross-hair in km.

npts: int

Number of points in the cross-hair, higher for better resolution.

ax : Axis

Axis to plot on. None will use the current axis.

static plot_grid_lines(ax=None, col='k', ls=':')[source]

Plot grid lines.

Parameters:
ax : Axis

Axis to plot on. None will use the current axis.

col : str or value

Color to use for grid lines.

ls : str

Linestyle to use for grid lines.

plot_label(self, label, location, symbol='r+', text_color='k', ax=None)[source]

Plot a single symbol and label at a given location.

Transforms of the symbol location in latitude and longitude units to x and y plot units is performed using an azimuthal equidistance map projection centered at the radar.

Parameters:
label : str

Label text to place just above symbol.

location : 2-tuples

Tuple of latitude, longitude (in degrees) at which the symbol will be place. The label is placed just above the symbol.

symbol : str

Matplotlib color+marker strings defining the symbol to place at the given location.

text_color : str

Matplotlib color defining the color of the label text.

ax : Axis

Axis to plot on. None will use the current axis.

plot_labels(self, labels, locations, symbols='r+', text_color='k', ax=None)[source]

Plot symbols and labels at given locations.

Parameters:
labels : list of str

List of labels to place just above symbols.

locations : list of 2-tuples

List of latitude, longitude (in degrees) tuples at which symbols will be place. Labels are placed just above the symbols.

symbols : list of str or str

List of matplotlib color+marker strings defining symbols to place at given locations. If a single string is provided, that symbol will be placed at all locations.

text_color : str

Matplotlib color defining the color of the label text.

ax : Axis

Axis to plot on. None will use the current axis.

plot_ppi(self, field, sweep=0, mask_tuple=None, vmin=None, vmax=None, norm=None, cmap=None, mask_outside=False, title=None, title_flag=True, axislabels=(None, None), axislabels_flag=True, colorbar_flag=True, colorbar_label=None, colorbar_orient='vertical', edges=True, gatefilter=None, filter_transitions=True, ax=None, fig=None, ticks=None, ticklabs=None, raster=False, title_datetime_format=None, title_use_sweep_time=True, **kwargs)[source]

Plot a PPI.

Additional arguments are passed to Matplotlib’s pcolormesh function.

Parameters:
field : str

Field to plot.

sweep : int, optional

Sweep number to plot.

Other Parameters:
 
mask_tuple : (str, float)

Tuple containing the field name and value below which to mask field prior to plotting, for example to mask all data where NCP < 0.5 set mask_tuple to [‘NCP’, 0.5]. None performs no masking.

vmin : float

Luminance minimum value, None for default value. Parameter is ignored is norm is not None.

vmax : float

Luminance maximum value, None for default value. Parameter is ignored is norm is not None.

norm : Normalize or None, optional

matplotlib Normalize instance used to scale luminance data. If not None the vmax and vmin parameters are ignored. If None, vmin and vmax are used for luminance scaling.

cmap : str or None

Matplotlib colormap name. None will use the default colormap for the field being plotted as specified by the Py-ART configuration.

mask_outside : bool

True to mask data outside of vmin, vmax. False performs no masking.

title : str

Title to label plot with, None to use default title generated from the field and sweep parameters. Parameter is ignored if title_flag is False.

title_datetime_format : str

Format of datetime in the title (using strftime format).

title_use_sweep_time : bool

True for the current sweep’s beginning time to be used for the title. False for the radar’s beginning time.

title_flag : bool

True to add a title to the plot, False does not add a title.

axislabels : (str, str)

2-tuple of x-axis, y-axis labels. None for either label will use the default axis label. Parameter is ignored if axislabels_flag is False.

axislabels_flag : bool

True to add label the axes, False does not label the axes.

colorbar_flag : bool

True to add a colorbar with label to the axis. False leaves off the colorbar.

colorbar_label : str

Colorbar label, None will use a default label generated from the field information.

colorbar_orient : ‘vertical’ or ‘horizontal’

Colorbar orientation.

ticks : array

Colorbar custom tick label locations.

ticklabs : array

Colorbar custom tick labels.

edges : bool

True will interpolate and extrapolate the gate edges from the range, azimuth and elevations in the radar, treating these as specifying the center of each gate. False treats these coordinates themselves as the gate edges, resulting in a plot in which the last gate in each ray and the entire last ray are not plotted.

gatefilter : GateFilter

GateFilter instance. None will result in no gatefilter mask being applied to data.

filter_transitions : bool

True to remove rays where the antenna was in transition between sweeps from the plot. False will include these rays in the plot. No rays are filtered when the antenna_transition attribute of the underlying radar is not present.

ax : Axis

Axis to plot on. None will use the current axis.

fig : Figure

Figure to add the colorbar to. None will use the current figure.

raster : bool

False by default. Set to true to render the display as a raster rather than a vector in call to pcolormesh. Saves time in plotting high resolution data over large areas. Be sure to set the dpi of the plot for your application if you save it as a vector format (i.e., pdf, eps, svg).

static plot_range_ring(range_ring_location_km, npts=100, ax=None, col='k', ls='-', lw=2)[source]

Plot a single range ring.

Parameters:
range_ring_location_km : float

Location of range ring in km.

npts: int

Number of points in the ring, higher for better resolution.

ax : Axis

Axis to plot on. None will use the current axis.

col : str or value

Color to use for range rings.

ls : str

Linestyle to use for range rings.

plot_range_rings(self, range_rings, ax=None, col='k', ls='-', lw=2)[source]

Plot a series of range rings.

Parameters:
range_rings : list

List of locations in km to draw range rings.

ax : Axis

Axis to plot on. None will use the current axis.

col : str or value

Color to use for range rings.

ls : str

Linestyle to use for range rings.

plot_ray(self, field, ray, format_str='k-', mask_tuple=None, ray_min=None, ray_max=None, mask_outside=False, title=None, title_flag=True, axislabels=(None, None), gatefilter=None, axislabels_flag=True, ax=None, fig=None)[source]

Plot a single ray.

Parameters:
field : str

Field to plot.

ray : int

Ray number to plot.

Other Parameters:
 
format_str : str

Format string defining the line style and marker.

mask_tuple : (str, float)

Tuple containing the field name and value below which to mask field prior to plotting, for example to mask all data where NCP < 0.5 set mask_tuple to [‘NCP’, 0.5]. None performs no masking.

ray_min : float

Minimum ray value, None for default value, ignored if mask_outside is False.

ray_max : float

Maximum ray value, None for default value, ignored if mask_outside is False.

mask_outside : bool

True to mask data outside of vmin, vmax. False performs no masking.

title : str

Title to label plot with, None to use default title generated from the field and ray parameters. Parameter is ignored if title_flag is False.

title_flag : bool

True to add a title to the plot, False does not add a title.

gatefilter : GateFilter

GateFilter instance. None will result in no gatefilter mask being applied to data.

axislabels : (str, str)

2-tuple of x-axis, y-axis labels. None for either label will use the default axis label. Parameter is ignored if axislabels_flag is False.

axislabels_flag : bool

True to add label the axes, False does not label the axes.

ax : Axis

Axis to plot on. None will use the current axis.

fig : Figure

Figure to add the colorbar to. None will use the current figure.

plot_rhi(self, field, sweep=0, mask_tuple=None, vmin=None, vmax=None, norm=None, cmap=None, mask_outside=False, title=None, title_flag=True, axislabels=(None, None), axislabels_flag=True, reverse_xaxis=None, colorbar_flag=True, colorbar_label=None, colorbar_orient='vertical', edges=True, gatefilter=None, filter_transitions=True, ax=None, fig=None, ticks=None, ticklabs=None, raster=False, title_datetime_format=None, title_use_sweep_time=True, **kwargs)[source]

Plot a RHI.

Additional arguments are passed to Matplotlib’s pcolormesh function.

Parameters:
field : str

Field to plot.

sweep : int,

Sweep number to plot.

Other Parameters:
 
mask_tuple : (str, float)

2-Tuple containing the field name and value below which to mask field prior to plotting, for example to mask all data where NCP < 0.5 set mask to [‘NCP’, 0.5]. None performs no masking.

vmin : float

Luminance minimum value, None for default value. Parameter is ignored is norm is not None.

vmax : float

Luminance maximum value, None for default value. Parameter is ignored is norm is not None.

norm : Normalize or None, optional

matplotlib Normalize instance used to scale luminance data. If not None the vmax and vmin parameters are ignored. If None, vmin and vmax are used for luminance scaling.

cmap : str or None

Matplotlib colormap name. None will use the default colormap for the field being plotted as specified by the Py-ART configuration.

title : str

Title to label plot with, None to use default title generated from the field and sweep parameters. Parameter is ignored if title_flag is False.

title_datetime_format : str

Format of datetime in the title (using strftime format).

title_use_sweep_time : bool

True for the current sweep’s beginning time to be used for the title. False for the radar’s beginning time.

title_flag : bool

True to add a title to the plot, False does not add a title.

axislabels : (str, str)

2-tuple of x-axis, y-axis labels. None for either label will use the default axis label. Parameter is ignored if axislabels_flag is False.

axislabels_flag : bool

True to add label the axes, False does not label the axes.

reverse_xaxis : bool or None

True to reverse the x-axis so the plot reads west to east, False to have east to west. None (the default) will reverse the axis only when all the distances are negative. (i.e) axis will be absolute distance without taking into consideration the orientation

colorbar_flag : bool

True to add a colorbar with label to the axis. False leaves off the colorbar.

colorbar_label : str

Colorbar label, None will use a default label generated from the field information.

colorbar_orient : ‘vertical’ or ‘horizontal’

Colorbar orientation.

ticks : array

Colorbar custom tick label locations.

ticklabs : array

Colorbar custom tick labels.

edges : bool

True will interpolate and extrapolate the gate edges from the range, azimuth and elevations in the radar, treating these as specifying the center of each gate. False treats these coordinates themselves as the gate edges, resulting in a plot in which the last gate in each ray and the entire last ray are not not plotted.

gatefilter : GateFilter

GateFilter instance. None will result in no gatefilter mask being applied to data.

filter_transitions : bool

True to remove rays where the antenna was in transition between sweeps from the plot. False will include these rays in the plot. No rays are filtered when the antenna_transition attribute of the underlying radar is not present.

ax : Axis

Axis to plot on. None will use the current axis.

fig : Figure

Figure to add the colorbar to. None will use the current figure.

raster : bool

False by default. Set to true to render the display as a raster rather than a vector in call to pcolormesh. Saves time in plotting high resolution data over large areas. Be sure to set the dpi of the plot for your application if you save it as a vector format (i.e., pdf, eps, svg).

plot_vpt(self, field, mask_tuple=None, vmin=None, vmax=None, norm=None, cmap=None, mask_outside=False, title=None, title_flag=True, axislabels=(None, None), axislabels_flag=True, colorbar_flag=True, colorbar_label=None, colorbar_orient='vertical', edges=True, gatefilter=None, filter_transitions=True, time_axis_flag=False, date_time_form=None, tz=None, ax=None, fig=None, ticks=None, ticklabs=None, raster=False, **kwargs)[source]

Plot a VPT scan.

Additional arguments are passed to Matplotlib’s pcolormesh function.

Parameters:
field : str

Field to plot.

Other Parameters:
 
mask_tuple : (str, float)

Tuple containing the field name and value below which to mask field prior to plotting, for example to mask all data where NCP < 0.5 set mask_tuple to [‘NCP’, 0.5]. None performs no masking.

vmin : float

Luminance minimum value, None for default value. Parameter is ignored is norm is not None.

vmax : float

Luminance maximum value, None for default value. Parameter is ignored is norm is not None.

norm : Normalize or None, optional

matplotlib Normalize instance used to scale luminance data. If not None the vmax and vmin parameters are ignored. If None, vmin and vmax are used for luminance scaling.

cmap : str or None

Matplotlib colormap name. None will use the default colormap for the field being plotted as specified by the Py-ART configuration.

mask_outside : bool

True to mask data outside of vmin, vmax. False performs no masking.

title : str

Title to label plot with, None to use default title generated from the field and sweep parameters. Parameter is ignored if title_flag is False.

title_flag : bool

True to add a title to the plot, False does not add a title.

axislabels : (str, str)

2-tuple of x-axis, y-axis labels. None for either label will use the default axis label. Parameter is ignored if axislabels_flag is False.

axislabels_flag : bool

True to add label the axes, False does not label the axes.

colorbar_flag : bool

True to add a colorbar with label to the axis. False leaves off the colorbar.

colorbar_label : str

Colorbar label, None will use a default label generated from the field information.

ticks : array

Colorbar custom tick label locations.

ticklabs : array

Colorbar custom tick labels.

colorbar_orient : ‘vertical’ or ‘horizontal’

Colorbar orientation.

edges : bool

True will interpolate and extrapolate the gate edges from the range, azimuth and elevations in the radar, treating these as specifying the center of each gate. False treats these coordinates themselves as the gate edges, resulting in a plot in which the last gate in each ray and the entire last ray are not not plotted.

gatefilter : GateFilter

GateFilter instance. None will result in no gatefilter mask being applied to data.

filter_transitions : bool

True to remove rays where the antenna was in transition between sweeps from the plot. False will include these rays in the plot. No rays are filtered when the antenna_transition attribute of the underlying radar is not present.

time_axis_flag : bool

True to plot the x-axis as time. False uses the index number. Default is False - index-based.

date_time_form : str, optional

Format of the time string for x-axis labels. Parameter is ignored if time_axis_flag is set to False.

tz : str, optional

Time zone info to use when creating axis labels (see datetime). Parameter is ignored if time_axis_flag is set to False.

ax : Axis

Axis to plot on. None will use the current axis.

fig : Figure

Figure to add the colorbar to. None will use the current figure.

raster : bool

False by default. Set to true to render the display as a raster rather than a vector in call to pcolormesh. Saves time in plotting high resolution data over large areas. Be sure to set the dpi of the plot for your application if you save it as a vector format (i.e., pdf, eps, svg).

static set_aspect_ratio(aspect_ratio=0.75, ax=None)[source]

Set the aspect ratio for plot area.

static set_limits(xlim=None, ylim=None, ax=None)[source]

Set the display limits.

Parameters:
xlim : tuple, optional

2-Tuple containing y-axis limits in km. None uses default limits.

ylim : tuple, optional

2-Tuple containing x-axis limits in km. None uses default limits.

ax : Axis

Axis to adjust. None will adjust the current axis.

class pyart.graph.RadarMapDisplay(radar, shift=(0.0, 0.0), grid_projection=None)[source]

Bases: pyart.graph.radardisplay.RadarDisplay

A display object for creating plots on a geographic map from data in a Radar object.

This class is still a work in progress. Some functionality may not work correctly. Please report any problems to the Py-ART GitHub Issue Tracker.

Parameters:
radar : Radar

Radar object to use for creating plots.

shift : (float, float)

Shifts in km to offset the calculated x and y locations.

Attributes:
plots : list

List of plots created.

plot_vars : list

List of fields plotted, order matches plot list.

cbs : list

List of colorbars created.

origin : str

‘Origin’ or ‘Radar’.

shift : (float, float)

Shift in meters.

loc : (float, float)

Latitude and Longitude of radar in degrees.

fields : dict

Radar fields.

scan_type : str

Scan type.

ranges : array

Gate ranges in meters.

azimuths : array

Azimuth angle in degrees.

elevations : array

Elevations in degrees.

fixed_angle : array

Scan angle in degrees.

grid_projection : cartopy.crs

AzimuthalEquidistant cartopy projection centered on radar. Used to transform points into map projection.

Methods

generate_az_rhi_title(self, field, azimuth) Generate a title for a ray plot.
generate_filename(self, field, sweep[, ext, …]) Generate a filename for a plot.
generate_ray_title(self, field, ray) Generate a title for a ray plot.
generate_title(self, field, sweep[, …]) Generate a title for a plot.
generate_vpt_title(self, field) Generate a title for a VPT plot.
label_xaxis_r(self[, ax]) Label the xaxis with the default label for r units.
label_xaxis_rays([ax]) Label the yaxis with the default label for rays.
label_xaxis_time([ax]) Label the yaxis with the default label for rays.
label_xaxis_x(self[, ax]) Label the xaxis with the default label for x units.
label_yaxis_field(self, field[, ax]) Label the yaxis with the default label for a field units.
label_yaxis_y(self[, ax]) Label the yaxis with the default label for y units.
label_yaxis_z(self[, ax]) Label the yaxis with the default label for z units.
plot(self, field[, sweep]) Create a plot appropiate for the radar.
plot_azimuth_to_rhi(self, field, target_azimuth) Plot pseudo-RHI scan by extracting the vertical field associated with the given azimuth.
plot_colorbar(self[, mappable, field, …]) Plot a colorbar.
plot_cross_hair(size[, npts, ax]) Plot a cross-hair on a ppi plot.
plot_grid_lines([ax, col, ls]) Plot grid lines.
plot_label(self, label, location[, symbol, …]) Plot a single symbol and label at a given location.
plot_labels(self, labels, locations[, …]) Plot symbols and labels at given locations.
plot_line_geo(self, line_lons, line_lats[, …]) Plot a line segments on the current map given values in lat and lon.
plot_line_xy(self, line_x, line_y[, line_style]) Plot a line segments on the current map given radar x, y values.
plot_point(self, lon, lat[, symbol, …]) Plot a point on the current map.
plot_ppi(self, field[, sweep, mask_tuple, …]) Plot a PPI.
plot_ppi_map(self, field[, sweep, …]) Plot a PPI volume sweep onto a geographic map.
plot_range_ring(self, range_ring_location_km) Plot a single range ring on the map.
plot_range_rings(self, range_rings[, ax, …]) Plot a series of range rings.
plot_ray(self, field, ray[, format_str, …]) Plot a single ray.
plot_rhi(self, field[, sweep, mask_tuple, …]) Plot a RHI.
plot_vpt(self, field[, mask_tuple, vmin, …]) Plot a VPT scan.
set_aspect_ratio([aspect_ratio, ax]) Set the aspect ratio for plot area.
set_limits([xlim, ylim, ax]) Set the display limits.
__class__

alias of builtins.type

__delattr__(self, name, /)

Implement delattr(self, name).

__dict__ = mappingproxy({'__module__': 'pyart.graph.radarmapdisplay', '__doc__': "\n A display object for creating plots on a geographic map from data in a\n Radar object.\n\n This class is still a work in progress. Some functionality may not work\n correctly. Please report any problems to the Py-ART GitHub Issue Tracker.\n\n Parameters\n ----------\n radar : Radar\n Radar object to use for creating plots.\n shift : (float, float)\n Shifts in km to offset the calculated x and y locations.\n\n Attributes\n ----------\n plots : list\n List of plots created.\n plot_vars : list\n List of fields plotted, order matches plot list.\n cbs : list\n List of colorbars created.\n origin : str\n 'Origin' or 'Radar'.\n shift : (float, float)\n Shift in meters.\n loc : (float, float)\n Latitude and Longitude of radar in degrees.\n fields : dict\n Radar fields.\n scan_type : str\n Scan type.\n ranges : array\n Gate ranges in meters.\n azimuths : array\n Azimuth angle in degrees.\n elevations : array\n Elevations in degrees.\n fixed_angle : array\n Scan angle in degrees.\n grid_projection : cartopy.crs\n AzimuthalEquidistant cartopy projection centered on radar.\n Used to transform points into map projection.\n\n ", '__init__': <function RadarMapDisplay.__init__>, '_check_ax': <function RadarMapDisplay._check_ax>, 'plot_ppi_map': <function RadarMapDisplay.plot_ppi_map>, 'plot_point': <function RadarMapDisplay.plot_point>, 'plot_line_geo': <function RadarMapDisplay.plot_line_geo>, 'plot_line_xy': <function RadarMapDisplay.plot_line_xy>, 'plot_range_ring': <function RadarMapDisplay.plot_range_ring>})
__dir__(self, /)

Default dir() implementation.

__eq__(self, value, /)

Return self==value.

__format__(self, format_spec, /)

Default object formatter.

__ge__(self, value, /)

Return self>=value.

__getattribute__(self, name, /)

Return getattr(self, name).

__gt__(self, value, /)

Return self>value.

__hash__(self, /)

Return hash(self).

__init__(self, radar, shift=(0.0, 0.0), grid_projection=None)[source]

Initialize the object.

__init_subclass__()

This method is called when a class is subclassed.

The default implementation does nothing. It may be overridden to extend subclasses.

__le__(self, value, /)

Return self<=value.

__lt__(self, value, /)

Return self<value.

__module__ = 'pyart.graph.radarmapdisplay'
__ne__(self, value, /)

Return self!=value.

__new__(*args, **kwargs)

Create and return a new object. See help(type) for accurate signature.

__reduce__(self, /)

Helper for pickle.

__reduce_ex__(self, protocol, /)

Helper for pickle.

__repr__(self, /)

Return repr(self).

__setattr__(self, name, value, /)

Implement setattr(self, name, value).

__sizeof__(self, /)

Size of object in memory, in bytes.

__str__(self, /)

Return str(self).

__subclasshook__()

Abstract classes can override this to customize issubclass().

This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).

__weakref__

list of weak references to the object (if defined)

_check_ax(self)[source]

Check that a GeoAxes object exists, raise ValueError if not

_get_azimuth_rhi_data_x_y_z(self, field, target_azimuth, edges, mask_tuple, filter_transitions, gatefilter)

Retrieve and return pseudo-RHI data from a plot function.

_get_colorbar_label(self, field)

Return a colorbar label for a given field.

_get_data(self, field, sweep, mask_tuple, filter_transitions, gatefilter)

Retrieve and return data from a plot function.

_get_ray_data(self, field, ray, mask_tuple, gatefilter)

Retrieve and return ray data from a plot function.

_get_vpt_data(self, field, mask_tuple, filter_transitions, gatefilter)

Retrieve and return vpt data from a plot function.

_get_x_y(self, sweep, edges, filter_transitions)

Retrieve and return x and y coordinate in km.

_get_x_y_z(self, sweep, edges, filter_transitions)

Retrieve and return x, y, and z coordinate in km.

_get_x_z(self, sweep, edges, filter_transitions)

Retrieve and return x and z coordinate in km.

_label_axes_ppi(self, axis_labels, ax)

Set the x and y axis labels for a PPI plot.

_label_axes_ray(self, axis_labels, field, ax)

Set the x and y axis labels for a ray plot.

_label_axes_rhi(self, axis_labels, ax)

Set the x and y axis labels for a RHI plot.

_label_axes_vpt(self, axis_labels, time_axis_flag, ax)

Set the x and y axis labels for a PPI plot.

_set_az_rhi_title(self, field, azimuth, title, ax)

Set the figure title for a ray plot using a default title.

_set_ray_title(self, field, ray, title, ax)

Set the figure title for a ray plot using a default title.

_set_title(self, field, sweep, title, ax, datetime_format=None, use_sweep_time=True)

Set the figure title using a default title.

static _set_vpt_time_axis(ax, date_time_form=None, tz=None)

Set the x axis as a time formatted axis.

Parameters:
ax : Matplotlib axis instance

Axis to plot. None will use the current axis.

date_time_form : str

Format of the time string for x-axis labels.

tz : str

Time zone info to use when creating axis labels (see datetime).

_set_vpt_title(self, field, title, ax)

Set the figure title using a default title.

generate_az_rhi_title(self, field, azimuth)

Generate a title for a ray plot.

Parameters:
field : str

Field plotted.

azimuth : float

Azimuth plotted.

Returns:
title : str

Plot title.

generate_filename(self, field, sweep, ext='png', datetime_format='%Y%m%d%H%M%S', use_sweep_time=False)

Generate a filename for a plot.

Generated filename has form:
radar_name_field_sweep_time.ext
Parameters:
field : str

Field plotted.

sweep : int

Sweep plotted.

ext : str

Filename extension.

datetime_format : str

Format of datetime (using strftime format).

use_sweep_time : bool

If true, the current sweep’s beginning time is used.

Returns:
filename : str

Filename suitable for saving a plot.

generate_ray_title(self, field, ray)

Generate a title for a ray plot.

Parameters:
field : str

Field plotted.

ray : int

Ray plotted.

Returns:
title : str

Plot title.

generate_title(self, field, sweep, datetime_format=None, use_sweep_time=True)

Generate a title for a plot.

Parameters:
field : str

Field plotted.

sweep : int

Sweep plotted.

datetime_format : str

Format of datetime (using strftime format).

use_sweep_time : bool

If true, the current sweep’s beginning time is used.

Returns:
title : str

Plot title.

generate_vpt_title(self, field)

Generate a title for a VPT plot.

Parameters:
field : str

Field plotted.

Returns:
title : str

Plot title.

label_xaxis_r(self, ax=None)

Label the xaxis with the default label for r units.

static label_xaxis_rays(ax=None)

Label the yaxis with the default label for rays.

static label_xaxis_time(ax=None)

Label the yaxis with the default label for rays.

label_xaxis_x(self, ax=None)

Label the xaxis with the default label for x units.

label_yaxis_field(self, field, ax=None)

Label the yaxis with the default label for a field units.

label_yaxis_y(self, ax=None)

Label the yaxis with the default label for y units.

label_yaxis_z(self, ax=None)

Label the yaxis with the default label for z units.

plot(self, field, sweep=0, **kwargs)

Create a plot appropiate for the radar.

This function calls the plotting function corresponding to the scan_type of the radar. Additional keywords can be passed to customize the plot, see the appropiate plot function for the allowed keywords.

Parameters:
field : str

Field to plot.

sweep : int

Sweep number to plot, not used for VPT scans.

See also

plot_ppi
Plot a PPI scan
plot_rhi
Plot a RHI scan
plot_vpt
Plot a VPT scan
plot_azimuth_to_rhi(self, field, target_azimuth, mask_tuple=None, vmin=None, vmax=None, norm=None, cmap=None, mask_outside=False, title=None, title_flag=True, axislabels=(None, None), axislabels_flag=True, colorbar_flag=True, colorbar_label=None, colorbar_orient='vertical', edges=True, gatefilter=None, reverse_xaxis=None, filter_transitions=True, ax=None, fig=None, ticks=None, ticklabs=None, raster=False, **kwargs)

Plot pseudo-RHI scan by extracting the vertical field associated with the given azimuth.

Additional arguments are passed to Matplotlib’s pcolormesh function.

Parameters:
field : str

Field to plot.

target_azimuth : integer

Azimuthal angle in degrees where cross section will be taken.

Other Parameters:
 
mask_tuple : (str, float)

2-Tuple containing the field name and value below which to mask field prior to plotting, for example to mask all data where NCP < 0.5 set mask to [‘NCP’, 0.5]. None performs no masking.

vmin : float

Luminance minimum value, None for default value. Parameter is ignored is norm is not None.

vmax : float

Luminance maximum value, None for default value. Parameter is ignored is norm is not None.

norm : Normalize or None, optional

matplotlib Normalize instance used to scale luminance data. If not None the vmax and vmin parameters are ignored. If None, vmin and vmax are used for luminance scaling.

cmap : str or None

Matplotlib colormap name. None will use the default colormap for the field being plotted as specified by the Py-ART configuration.

title : str

Title to label plot with, None to use default title generated from the field and sweep parameters. Parameter is ignored if title_flag is False.

title_flag : bool

True to add a title to the plot, False does not add a title.

axislabels : (str, str)

2-tuple of x-axis, y-axis labels. None for either label will use the default axis label. Parameter is ignored if axislabels_flag is False.

axislabels_flag : bool

True to add label the axes, False does not label the axes.

reverse_xaxis : bool or None

True to reverse the x-axis so the plot reads east to west, False to have east to west. None (the default) will reverse the axis only when all the distances are negative.

colorbar_flag : bool

True to add a colorbar with label to the axis. False leaves off the colorbar.

colorbar_label : str

Colorbar label, None will use a default label generated from the field information.

ticks : array

Colorbar custom tick label locations.

ticklabs : array

Colorbar custom tick labels.

colorbar_orient : ‘vertical’ or ‘horizontal’

Colorbar orientation.

edges : bool

True will interpolate and extrapolate the gate edges from the range, azimuth and elevations in the radar, treating these as specifying the center of each gate. False treats these coordinates themselves as the gate edges, resulting in a plot in which the last gate in each ray and the entire last ray are not not plotted.

gatefilter : GateFilter

GateFilter instance. None will result in no gatefilter mask being applied to data.

filter_transitions : bool

True to remove rays where the antenna was in transition between sweeps from the plot. False will include these rays in the plot. No rays are filtered when the antenna_transition attribute of the underlying radar is not present.

ax : Axis

Axis to plot on. None will use the current axis.

fig : Figure

Figure to add the colorbar to. None will use the current figure.

raster : bool

False by default. Set to True to render the display as a raster rather than a vector in call to pcolormesh. Saves time in plotting high resolution data over large areas. Be sure to set the dpi of the plot for your application if you save it as a vector format (i.e., pdf, eps, svg).

plot_colorbar(self, mappable=None, field=None, label=None, orient='vertical', cax=None, ax=None, fig=None, ticks=None, ticklabs=None)

Plot a colorbar.

Parameters:
mappable : Image, ContourSet, etc.

Image, ContourSet, etc to which the colorbar applied. If None the last mappable object will be used.

field : str

Field to label colorbar with.

label : str

Colorbar label. None will use a default value from the last field plotted.

orient : str

Colorbar orientation, either ‘vertical’ [default] or ‘horizontal’.

cax : Axis

Axis onto which the colorbar will be drawn. None is also valid.

ax : Axes

Axis onto which the colorbar will be drawn. None is also valid.

fig : Figure

Figure to place colorbar on. None will use the current figure.

ticks : array

Colorbar custom tick label locations.

ticklabs : array

Colorbar custom tick labels.

static plot_cross_hair(size, npts=100, ax=None)

Plot a cross-hair on a ppi plot.

Parameters:
size : float

Size of cross-hair in km.

npts: int

Number of points in the cross-hair, higher for better resolution.

ax : Axis

Axis to plot on. None will use the current axis.

static plot_grid_lines(ax=None, col='k', ls=':')

Plot grid lines.

Parameters:
ax : Axis

Axis to plot on. None will use the current axis.

col : str or value

Color to use for grid lines.

ls : str

Linestyle to use for grid lines.

plot_label(self, label, location, symbol='r+', text_color='k', ax=None)

Plot a single symbol and label at a given location.

Transforms of the symbol location in latitude and longitude units to x and y plot units is performed using an azimuthal equidistance map projection centered at the radar.

Parameters:
label : str

Label text to place just above symbol.

location : 2-tuples

Tuple of latitude, longitude (in degrees) at which the symbol will be place. The label is placed just above the symbol.

symbol : str

Matplotlib color+marker strings defining the symbol to place at the given location.

text_color : str

Matplotlib color defining the color of the label text.

ax : Axis

Axis to plot on. None will use the current axis.

plot_labels(self, labels, locations, symbols='r+', text_color='k', ax=None)

Plot symbols and labels at given locations.

Parameters:
labels : list of str

List of labels to place just above symbols.

locations : list of 2-tuples

List of latitude, longitude (in degrees) tuples at which symbols will be place. Labels are placed just above the symbols.

symbols : list of str or str

List of matplotlib color+marker strings defining symbols to place at given locations. If a single string is provided, that symbol will be placed at all locations.

text_color : str

Matplotlib color defining the color of the label text.

ax : Axis

Axis to plot on. None will use the current axis.

plot_line_geo(self, line_lons, line_lats, line_style='r-', **kwargs)[source]

Plot a line segments on the current map given values in lat and lon.

Additional arguments are passed to ax.plot.

Parameters:
line_lons : array

Longitude of line segment to plot.

line_lats : array

Latitude of line segment to plot.

line_style : str

Matplotlib compatible string which specifies the line style.

plot_line_xy(self, line_x, line_y, line_style='r-', **kwargs)[source]

Plot a line segments on the current map given radar x, y values.

Additional arguments are passed to ax.plot.

Parameters:
line_x : array

X location of points to plot in meters from the radar.

line_y : array

Y location of points to plot in meters from the radar.

line_style : str, optional

Matplotlib compatible string which specifies the line style.

plot_point(self, lon, lat, symbol='ro', label_text=None, label_offset=(None, None), **kwargs)[source]

Plot a point on the current map.

Additional arguments are passed to ax.plot.

Parameters:
lon : float

Longitude of point to plot.

lat : float

Latitude of point to plot.

symbol : str

Matplotlib compatible string which specified the symbol of the point.

label_text : str, optional.

Text to label symbol with. If None no label will be added.

label_offset : [float, float]

Offset in lon, lat degrees for the bottom left corner of the label text relative to the point. A value of None will use 0.01.

plot_ppi(self, field, sweep=0, mask_tuple=None, vmin=None, vmax=None, norm=None, cmap=None, mask_outside=False, title=None, title_flag=True, axislabels=(None, None), axislabels_flag=True, colorbar_flag=True, colorbar_label=None, colorbar_orient='vertical', edges=True, gatefilter=None, filter_transitions=True, ax=None, fig=None, ticks=None, ticklabs=None, raster=False, title_datetime_format=None, title_use_sweep_time=True, **kwargs)

Plot a PPI.

Additional arguments are passed to Matplotlib’s pcolormesh function.

Parameters:
field : str

Field to plot.

sweep : int, optional

Sweep number to plot.

Other Parameters:
 
mask_tuple : (str, float)

Tuple containing the field name and value below which to mask field prior to plotting, for example to mask all data where NCP < 0.5 set mask_tuple to [‘NCP’, 0.5]. None performs no masking.

vmin : float

Luminance minimum value, None for default value. Parameter is ignored is norm is not None.

vmax : float

Luminance maximum value, None for default value. Parameter is ignored is norm is not None.

norm : Normalize or None, optional

matplotlib Normalize instance used to scale luminance data. If not None the vmax and vmin parameters are ignored. If None, vmin and vmax are used for luminance scaling.

cmap : str or None

Matplotlib colormap name. None will use the default colormap for the field being plotted as specified by the Py-ART configuration.

mask_outside : bool

True to mask data outside of vmin, vmax. False performs no masking.

title : str

Title to label plot with, None to use default title generated from the field and sweep parameters. Parameter is ignored if title_flag is False.

title_datetime_format : str

Format of datetime in the title (using strftime format).

title_use_sweep_time : bool

True for the current sweep’s beginning time to be used for the title. False for the radar’s beginning time.

title_flag : bool

True to add a title to the plot, False does not add a title.

axislabels : (str, str)

2-tuple of x-axis, y-axis labels. None for either label will use the default axis label. Parameter is ignored if axislabels_flag is False.

axislabels_flag : bool

True to add label the axes, False does not label the axes.

colorbar_flag : bool

True to add a colorbar with label to the axis. False leaves off the colorbar.

colorbar_label : str

Colorbar label, None will use a default label generated from the field information.

colorbar_orient : ‘vertical’ or ‘horizontal’

Colorbar orientation.

ticks : array

Colorbar custom tick label locations.

ticklabs : array

Colorbar custom tick labels.

edges : bool

True will interpolate and extrapolate the gate edges from the range, azimuth and elevations in the radar, treating these as specifying the center of each gate. False treats these coordinates themselves as the gate edges, resulting in a plot in which the last gate in each ray and the entire last ray are not plotted.

gatefilter : GateFilter

GateFilter instance. None will result in no gatefilter mask being applied to data.

filter_transitions : bool

True to remove rays where the antenna was in transition between sweeps from the plot. False will include these rays in the plot. No rays are filtered when the antenna_transition attribute of the underlying radar is not present.

ax : Axis

Axis to plot on. None will use the current axis.

fig : Figure

Figure to add the colorbar to. None will use the current figure.

raster : bool

False by default. Set to true to render the display as a raster rather than a vector in call to pcolormesh. Saves time in plotting high resolution data over large areas. Be sure to set the dpi of the plot for your application if you save it as a vector format (i.e., pdf, eps, svg).

plot_ppi_map(self, field, sweep=0, mask_tuple=None, vmin=None, vmax=None, cmap=None, norm=None, mask_outside=False, title=None, title_flag=True, colorbar_flag=True, colorbar_label=None, ax=None, fig=None, lat_lines=None, lon_lines=None, projection=None, min_lon=None, max_lon=None, min_lat=None, max_lat=None, width=None, height=None, lon_0=None, lat_0=None, resolution='110m', shapefile=None, shapefile_kwargs=None, edges=True, gatefilter=None, filter_transitions=True, embelish=True, maps_list=['countries', 'coastlines'], raster=False, ticks=None, ticklabs=None, alpha=None, background_zoom=8)[source]

Plot a PPI volume sweep onto a geographic map.

Parameters:
field : str

Field to plot.

sweep : int, optional

Sweep number to plot.

Other Parameters:
 
mask_tuple : (str, float)

Tuple containing the field name and value below which to mask field prior to plotting, for example to mask all data where NCP < 0.5 set mask_tuple to [‘NCP’, 0.5]. None performs no masking.

vmin : float

Luminance minimum value, None for default value. Parameter is ignored is norm is not None.

vmax : float

Luminance maximum value, None for default value. Parameter is ignored is norm is not None.

norm : Normalize or None, optional

matplotlib Normalize instance used to scale luminance data. If not None the vmax and vmin parameters are ignored. If None, vmin and vmax are used for luminance scaling.

cmap : str or None

Matplotlib colormap name. None will use the default colormap for the field being plotted as specified by the Py-ART configuration.

mask_outside : bool

True to mask data outside of vmin, vmax. False performs no masking.

title : str

Title to label plot with, None to use default title generated from the field and tilt parameters. Parameter is ignored if title_flag is False.

title_flag : bool

True to add a title to the plot, False does not add a title.

colorbar_flag : bool

True to add a colorbar with label to the axis. False leaves off the colorbar.

ticks : array

Colorbar custom tick label locations.

ticklabs : array

Colorbar custom tick labels.

colorbar_label : str

Colorbar label, None will use a default label generated from the field information.

ax : Cartopy GeoAxes instance

If None, create GeoAxes instance using other keyword info. If provided, ax must have a Cartopy crs projection and projection kwarg below is ignored.

fig : Figure

Figure to add the colorbar to. None will use the current figure.

lat_lines, lon_lines : array or None

Locations at which to draw latitude and longitude lines. None will use default values which are resonable for maps of North America.

projection : cartopy.crs class

Map projection supported by cartopy. Used for all subsequent calls to the GeoAxes object generated. Defaults to LambertConformal centered on radar.

min_lat, max_lat, min_lon, max_lon : float

Latitude and longitude ranges for the map projection region in degrees.

width, height : float

Width and height of map domain in meters. Only this set of parameters or the previous set of parameters (min_lat, max_lat, min_lon, max_lon) should be specified. If neither set is specified then the map domain will be determined from the extend of the radar gate locations.

shapefile : str

Filename for a shapefile to add to map.

shapefile_kwargs : dict

Key word arguments used to format shapefile. Projection defaults to lat lon (cartopy.crs.PlateCarree())

resolution : ‘10m’, ‘50m’, ‘110m’.

Resolution of NaturalEarthFeatures to use. See Cartopy documentation for details.

gatefilter : GateFilter

GateFilter instance. None will result in no gatefilter mask being applied to data.

filter_transitions : bool

True to remove rays where the antenna was in transition between sweeps from the plot. False will include these rays in the plot. No rays are filtered when the antenna_transition attribute of the underlying radar is not present.

edges : bool

True will interpolate and extrapolate the gate edges from the range, azimuth and elevations in the radar, treating these as specifying the center of each gate. False treats these coordinates themselved as the gate edges, resulting in a plot in which the last gate in each ray and the entire last ray are not not plotted.

embelish: bool

True by default. Set to False to supress drawing of coastlines etc.. Use for speedup when specifying shapefiles. Note that lat lon labels only work with certain projections.

maps_list: list of strings

if embelish is true the list of maps to use. default countries, coastlines

raster : bool

False by default. Set to true to render the display as a raster rather than a vector in call to pcolormesh. Saves time in plotting high resolution data over large areas. Be sure to set the dpi of the plot for your application if you save it as a vector format (i.e., pdf, eps, svg).

alpha : float or None

Set the alpha transparency of the radar plot. Useful for overplotting radar over other datasets.

background_zoom : int

Zoom of the background image. A highest number provides more detail at the cost of processing speed

plot_range_ring(self, range_ring_location_km, npts=360, line_style='k-', **kwargs)[source]

Plot a single range ring on the map.

Additional arguments are passed to ax.plot.

Parameters:
range_ring_location_km : float

Location of range ring in km.

npts : int

Number of points in the ring, higher for better resolution.

line_style : str

Matplotlib compatible string which specified the line style of the ring.

plot_range_rings(self, range_rings, ax=None, col='k', ls='-', lw=2)

Plot a series of range rings.

Parameters:
range_rings : list

List of locations in km to draw range rings.

ax : Axis

Axis to plot on. None will use the current axis.

col : str or value

Color to use for range rings.

ls : str

Linestyle to use for range rings.

plot_ray(self, field, ray, format_str='k-', mask_tuple=None, ray_min=None, ray_max=None, mask_outside=False, title=None, title_flag=True, axislabels=(None, None), gatefilter=None, axislabels_flag=True, ax=None, fig=None)

Plot a single ray.

Parameters:
field : str

Field to plot.

ray : int

Ray number to plot.

Other Parameters:
 
format_str : str

Format string defining the line style and marker.

mask_tuple : (str, float)

Tuple containing the field name and value below which to mask field prior to plotting, for example to mask all data where NCP < 0.5 set mask_tuple to [‘NCP’, 0.5]. None performs no masking.

ray_min : float

Minimum ray value, None for default value, ignored if mask_outside is False.

ray_max : float

Maximum ray value, None for default value, ignored if mask_outside is False.

mask_outside : bool

True to mask data outside of vmin, vmax. False performs no masking.

title : str

Title to label plot with, None to use default title generated from the field and ray parameters. Parameter is ignored if title_flag is False.

title_flag : bool

True to add a title to the plot, False does not add a title.

gatefilter : GateFilter

GateFilter instance. None will result in no gatefilter mask being applied to data.

axislabels : (str, str)

2-tuple of x-axis, y-axis labels. None for either label will use the default axis label. Parameter is ignored if axislabels_flag is False.

axislabels_flag : bool

True to add label the axes, False does not label the axes.

ax : Axis

Axis to plot on. None will use the current axis.

fig : Figure

Figure to add the colorbar to. None will use the current figure.

plot_rhi(self, field, sweep=0, mask_tuple=None, vmin=None, vmax=None, norm=None, cmap=None, mask_outside=False, title=None, title_flag=True, axislabels=(None, None), axislabels_flag=True, reverse_xaxis=None, colorbar_flag=True, colorbar_label=None, colorbar_orient='vertical', edges=True, gatefilter=None, filter_transitions=True, ax=None, fig=None, ticks=None, ticklabs=None, raster=False, title_datetime_format=None, title_use_sweep_time=True, **kwargs)

Plot a RHI.

Additional arguments are passed to Matplotlib’s pcolormesh function.

Parameters:
field : str

Field to plot.

sweep : int,

Sweep number to plot.

Other Parameters:
 
mask_tuple : (str, float)

2-Tuple containing the field name and value below which to mask field prior to plotting, for example to mask all data where NCP < 0.5 set mask to [‘NCP’, 0.5]. None performs no masking.

vmin : float

Luminance minimum value, None for default value. Parameter is ignored is norm is not None.

vmax : float

Luminance maximum value, None for default value. Parameter is ignored is norm is not None.

norm : Normalize or None, optional

matplotlib Normalize instance used to scale luminance data. If not None the vmax and vmin parameters are ignored. If None, vmin and vmax are used for luminance scaling.

cmap : str or None

Matplotlib colormap name. None will use the default colormap for the field being plotted as specified by the Py-ART configuration.

title : str

Title to label plot with, None to use default title generated from the field and sweep parameters. Parameter is ignored if title_flag is False.

title_datetime_format : str

Format of datetime in the title (using strftime format).

title_use_sweep_time : bool

True for the current sweep’s beginning time to be used for the title. False for the radar’s beginning time.

title_flag : bool

True to add a title to the plot, False does not add a title.

axislabels : (str, str)

2-tuple of x-axis, y-axis labels. None for either label will use the default axis label. Parameter is ignored if axislabels_flag is False.

axislabels_flag : bool

True to add label the axes, False does not label the axes.

reverse_xaxis : bool or None

True to reverse the x-axis so the plot reads west to east, False to have east to west. None (the default) will reverse the axis only when all the distances are negative. (i.e) axis will be absolute distance without taking into consideration the orientation

colorbar_flag : bool

True to add a colorbar with label to the axis. False leaves off the colorbar.

colorbar_label : str

Colorbar label, None will use a default label generated from the field information.

colorbar_orient : ‘vertical’ or ‘horizontal’

Colorbar orientation.

ticks : array

Colorbar custom tick label locations.

ticklabs : array

Colorbar custom tick labels.

edges : bool

True will interpolate and extrapolate the gate edges from the range, azimuth and elevations in the radar, treating these as specifying the center of each gate. False treats these coordinates themselves as the gate edges, resulting in a plot in which the last gate in each ray and the entire last ray are not not plotted.

gatefilter : GateFilter

GateFilter instance. None will result in no gatefilter mask being applied to data.

filter_transitions : bool

True to remove rays where the antenna was in transition between sweeps from the plot. False will include these rays in the plot. No rays are filtered when the antenna_transition attribute of the underlying radar is not present.

ax : Axis

Axis to plot on. None will use the current axis.

fig : Figure

Figure to add the colorbar to. None will use the current figure.

raster : bool

False by default. Set to true to render the display as a raster rather than a vector in call to pcolormesh. Saves time in plotting high resolution data over large areas. Be sure to set the dpi of the plot for your application if you save it as a vector format (i.e., pdf, eps, svg).

plot_vpt(self, field, mask_tuple=None, vmin=None, vmax=None, norm=None, cmap=None, mask_outside=False, title=None, title_flag=True, axislabels=(None, None), axislabels_flag=True, colorbar_flag=True, colorbar_label=None, colorbar_orient='vertical', edges=True, gatefilter=None, filter_transitions=True, time_axis_flag=False, date_time_form=None, tz=None, ax=None, fig=None, ticks=None, ticklabs=None, raster=False, **kwargs)

Plot a VPT scan.

Additional arguments are passed to Matplotlib’s pcolormesh function.

Parameters:
field : str

Field to plot.

Other Parameters:
 
mask_tuple : (str, float)

Tuple containing the field name and value below which to mask field prior to plotting, for example to mask all data where NCP < 0.5 set mask_tuple to [‘NCP’, 0.5]. None performs no masking.

vmin : float

Luminance minimum value, None for default value. Parameter is ignored is norm is not None.

vmax : float

Luminance maximum value, None for default value. Parameter is ignored is norm is not None.

norm : Normalize or None, optional

matplotlib Normalize instance used to scale luminance data. If not None the vmax and vmin parameters are ignored. If None, vmin and vmax are used for luminance scaling.

cmap : str or None

Matplotlib colormap name. None will use the default colormap for the field being plotted as specified by the Py-ART configuration.

mask_outside : bool

True to mask data outside of vmin, vmax. False performs no masking.

title : str

Title to label plot with, None to use default title generated from the field and sweep parameters. Parameter is ignored if title_flag is False.

title_flag : bool

True to add a title to the plot, False does not add a title.

axislabels : (str, str)

2-tuple of x-axis, y-axis labels. None for either label will use the default axis label. Parameter is ignored if axislabels_flag is False.

axislabels_flag : bool

True to add label the axes, False does not label the axes.

colorbar_flag : bool

True to add a colorbar with label to the axis. False leaves off the colorbar.

colorbar_label : str

Colorbar label, None will use a default label generated from the field information.

ticks : array

Colorbar custom tick label locations.

ticklabs : array

Colorbar custom tick labels.

colorbar_orient : ‘vertical’ or ‘horizontal’

Colorbar orientation.

edges : bool

True will interpolate and extrapolate the gate edges from the range, azimuth and elevations in the radar, treating these as specifying the center of each gate. False treats these coordinates themselves as the gate edges, resulting in a plot in which the last gate in each ray and the entire last ray are not not plotted.

gatefilter : GateFilter

GateFilter instance. None will result in no gatefilter mask being applied to data.

filter_transitions : bool

True to remove rays where the antenna was in transition between sweeps from the plot. False will include these rays in the plot. No rays are filtered when the antenna_transition attribute of the underlying radar is not present.

time_axis_flag : bool

True to plot the x-axis as time. False uses the index number. Default is False - index-based.

date_time_form : str, optional

Format of the time string for x-axis labels. Parameter is ignored if time_axis_flag is set to False.

tz : str, optional

Time zone info to use when creating axis labels (see datetime). Parameter is ignored if time_axis_flag is set to False.

ax : Axis

Axis to plot on. None will use the current axis.

fig : Figure

Figure to add the colorbar to. None will use the current figure.

raster : bool

False by default. Set to true to render the display as a raster rather than a vector in call to pcolormesh. Saves time in plotting high resolution data over large areas. Be sure to set the dpi of the plot for your application if you save it as a vector format (i.e., pdf, eps, svg).

static set_aspect_ratio(aspect_ratio=0.75, ax=None)

Set the aspect ratio for plot area.

static set_limits(xlim=None, ylim=None, ax=None)

Set the display limits.

Parameters:
xlim : tuple, optional

2-Tuple containing y-axis limits in km. None uses default limits.

ylim : tuple, optional

2-Tuple containing x-axis limits in km. None uses default limits.

ax : Axis

Axis to adjust. None will adjust the current axis.

class pyart.graph.RadarMapDisplayBasemap(radar, shift=(0.0, 0.0))[source]

Bases: pyart.graph.radardisplay.RadarDisplay

A display object for creating plots on a geographic map from data in a Radar object.

This class is still a work in progress. Some functionality may not work correctly. Please report any problems to the Py-ART GitHub Issue Tracker.

Parameters:
radar : Radar

Radar object to use for creating plots.

shift : (float, float)

Shifts in km to offset the calculated x and y locations.

Attributes:
plots : list

List of plots created.

plot_vars : list

List of fields plotted, order matches plot list.

cbs : list

List of colorbars created.

origin : str

‘Origin’ or ‘Radar’.

shift : (float, float)

Shift in meters.

loc : (float, float)

Latitude and Longitude of radar in degrees.

fields : dict

Radar fields.

scan_type : str

Scan type.

ranges : array

Gate ranges in meters.

azimuths : array

Azimuth angle in degrees.

elevations : array

Elevations in degrees.

fixed_angle : array

Scan angle in degrees.

proj : Proj

Object for performing cartographic transformations specific to the geographic map plotted.

basemap : Basemap

Last plotted basemap, None when no basemap has been plotted.

Methods

generate_az_rhi_title(self, field, azimuth) Generate a title for a ray plot.
generate_filename(self, field, sweep[, ext, …]) Generate a filename for a plot.
generate_ray_title(self, field, ray) Generate a title for a ray plot.
generate_title(self, field, sweep[, …]) Generate a title for a plot.
generate_vpt_title(self, field) Generate a title for a VPT plot.
label_xaxis_r(self[, ax]) Label the xaxis with the default label for r units.
label_xaxis_rays([ax]) Label the yaxis with the default label for rays.
label_xaxis_time([ax]) Label the yaxis with the default label for rays.
label_xaxis_x(self[, ax]) Label the xaxis with the default label for x units.
label_yaxis_field(self, field[, ax]) Label the yaxis with the default label for a field units.
label_yaxis_y(self[, ax]) Label the yaxis with the default label for y units.
label_yaxis_z(self[, ax]) Label the yaxis with the default label for z units.
plot(self, field[, sweep]) Create a plot appropiate for the radar.
plot_azimuth_to_rhi(self, field, target_azimuth) Plot pseudo-RHI scan by extracting the vertical field associated with the given azimuth.
plot_colorbar(self[, mappable, field, …]) Plot a colorbar.
plot_cross_hair(size[, npts, ax]) Plot a cross-hair on a ppi plot.
plot_grid_lines([ax, col, ls]) Plot grid lines.
plot_label(self, label, location[, symbol, …]) Plot a single symbol and label at a given location.
plot_labels(self, labels, locations[, …]) Plot symbols and labels at given locations.
plot_line_geo(self, line_lons, line_lats[, …]) Plot a line segments on the current map given values in lat and lon.
plot_line_xy(self, line_x, line_y[, line_style]) Plot a line segments on the current map given radar x, y values.
plot_point(self, lon, lat[, symbol, …]) Plot a point on the current map.
plot_ppi(self, field[, sweep, mask_tuple, …]) Plot a PPI.
plot_ppi_map(self, field[, sweep, …]) Plot a PPI volume sweep onto a geographic map.
plot_range_ring(self, range_ring_location_km) Plot a single range ring on the map.
plot_range_rings(self, range_rings[, ax, …]) Plot a series of range rings.
plot_ray(self, field, ray[, format_str, …]) Plot a single ray.
plot_rhi(self, field[, sweep, mask_tuple, …]) Plot a RHI.
plot_vpt(self, field[, mask_tuple, vmin, …]) Plot a VPT scan.
set_aspect_ratio([aspect_ratio, ax]) Set the aspect ratio for plot area.
set_limits([xlim, ylim, ax]) Set the display limits.
__class__

alias of builtins.type

__delattr__(self, name, /)

Implement delattr(self, name).

__dict__ = mappingproxy({'__module__': 'pyart.graph.radarmapdisplay_basemap', '__doc__': "\n A display object for creating plots on a geographic map from data in a\n Radar object.\n\n This class is still a work in progress. Some functionality may not work\n correctly. Please report any problems to the Py-ART GitHub Issue Tracker.\n\n Parameters\n ----------\n radar : Radar\n Radar object to use for creating plots.\n shift : (float, float)\n Shifts in km to offset the calculated x and y locations.\n\n Attributes\n ----------\n plots : list\n List of plots created.\n plot_vars : list\n List of fields plotted, order matches plot list.\n cbs : list\n List of colorbars created.\n origin : str\n 'Origin' or 'Radar'.\n shift : (float, float)\n Shift in meters.\n loc : (float, float)\n Latitude and Longitude of radar in degrees.\n fields : dict\n Radar fields.\n scan_type : str\n Scan type.\n ranges : array\n Gate ranges in meters.\n azimuths : array\n Azimuth angle in degrees.\n elevations : array\n Elevations in degrees.\n fixed_angle : array\n Scan angle in degrees.\n proj : Proj\n Object for performing cartographic transformations specific to the\n geographic map plotted.\n basemap : Basemap\n Last plotted basemap, None when no basemap has been plotted.\n\n\n ", '__init__': <function RadarMapDisplayBasemap.__init__>, '_check_basemap': <function RadarMapDisplayBasemap._check_basemap>, 'plot_ppi_map': <function RadarMapDisplayBasemap.plot_ppi_map>, 'plot_point': <function RadarMapDisplayBasemap.plot_point>, 'plot_line_geo': <function RadarMapDisplayBasemap.plot_line_geo>, 'plot_line_xy': <function RadarMapDisplayBasemap.plot_line_xy>, 'plot_range_ring': <function RadarMapDisplayBasemap.plot_range_ring>})
__dir__(self, /)

Default dir() implementation.

__eq__(self, value, /)

Return self==value.

__format__(self, format_spec, /)

Default object formatter.

__ge__(self, value, /)

Return self>=value.

__getattribute__(self, name, /)

Return getattr(self, name).

__gt__(self, value, /)

Return self>value.

__hash__(self, /)

Return hash(self).

__init__(self, radar, shift=(0.0, 0.0))[source]

Initialize the object.

__init_subclass__()

This method is called when a class is subclassed.

The default implementation does nothing. It may be overridden to extend subclasses.

__le__(self, value, /)

Return self<=value.

__lt__(self, value, /)

Return self<value.

__module__ = 'pyart.graph.radarmapdisplay_basemap'
__ne__(self, value, /)

Return self!=value.

__new__(*args, **kwargs)

Create and return a new object. See help(type) for accurate signature.

__reduce__(self, /)

Helper for pickle.

__reduce_ex__(self, protocol, /)

Helper for pickle.

__repr__(self, /)

Return repr(self).

__setattr__(self, name, value, /)

Implement setattr(self, name, value).

__sizeof__(self, /)

Size of object in memory, in bytes.

__str__(self, /)

Return str(self).

__subclasshook__()

Abstract classes can override this to customize issubclass().

This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).

__weakref__

list of weak references to the object (if defined)

_check_basemap(self)[source]

Check that basemap is not None, raise ValueError if it is.

_get_azimuth_rhi_data_x_y_z(self, field, target_azimuth, edges, mask_tuple, filter_transitions, gatefilter)

Retrieve and return pseudo-RHI data from a plot function.

_get_colorbar_label(self, field)

Return a colorbar label for a given field.

_get_data(self, field, sweep, mask_tuple, filter_transitions, gatefilter)

Retrieve and return data from a plot function.

_get_ray_data(self, field, ray, mask_tuple, gatefilter)

Retrieve and return ray data from a plot function.

_get_vpt_data(self, field, mask_tuple, filter_transitions, gatefilter)

Retrieve and return vpt data from a plot function.

_get_x_y(self, sweep, edges, filter_transitions)

Retrieve and return x and y coordinate in km.

_get_x_y_z(self, sweep, edges, filter_transitions)

Retrieve and return x, y, and z coordinate in km.

_get_x_z(self, sweep, edges, filter_transitions)

Retrieve and return x and z coordinate in km.

_label_axes_ppi(self, axis_labels, ax)

Set the x and y axis labels for a PPI plot.

_label_axes_ray(self, axis_labels, field, ax)

Set the x and y axis labels for a ray plot.

_label_axes_rhi(self, axis_labels, ax)

Set the x and y axis labels for a RHI plot.

_label_axes_vpt(self, axis_labels, time_axis_flag, ax)

Set the x and y axis labels for a PPI plot.

_set_az_rhi_title(self, field, azimuth, title, ax)

Set the figure title for a ray plot using a default title.

_set_ray_title(self, field, ray, title, ax)

Set the figure title for a ray plot using a default title.

_set_title(self, field, sweep, title, ax, datetime_format=None, use_sweep_time=True)

Set the figure title using a default title.

static _set_vpt_time_axis(ax, date_time_form=None, tz=None)

Set the x axis as a time formatted axis.

Parameters:
ax : Matplotlib axis instance

Axis to plot. None will use the current axis.

date_time_form : str

Format of the time string for x-axis labels.

tz : str

Time zone info to use when creating axis labels (see datetime).

_set_vpt_title(self, field, title, ax)

Set the figure title using a default title.

generate_az_rhi_title(self, field, azimuth)

Generate a title for a ray plot.

Parameters:
field : str

Field plotted.

azimuth : float

Azimuth plotted.

Returns:
title : str

Plot title.

generate_filename(self, field, sweep, ext='png', datetime_format='%Y%m%d%H%M%S', use_sweep_time=False)

Generate a filename for a plot.

Generated filename has form:
radar_name_field_sweep_time.ext
Parameters:
field : str

Field plotted.

sweep : int

Sweep plotted.

ext : str

Filename extension.

datetime_format : str

Format of datetime (using strftime format).

use_sweep_time : bool

If true, the current sweep’s beginning time is used.

Returns:
filename : str

Filename suitable for saving a plot.

generate_ray_title(self, field, ray)

Generate a title for a ray plot.

Parameters:
field : str

Field plotted.

ray : int

Ray plotted.

Returns:
title : str

Plot title.

generate_title(self, field, sweep, datetime_format=None, use_sweep_time=True)

Generate a title for a plot.

Parameters:
field : str

Field plotted.

sweep : int

Sweep plotted.

datetime_format : str

Format of datetime (using strftime format).

use_sweep_time : bool

If true, the current sweep’s beginning time is used.

Returns:
title : str

Plot title.

generate_vpt_title(self, field)

Generate a title for a VPT plot.

Parameters:
field : str

Field plotted.

Returns:
title : str

Plot title.

label_xaxis_r(self, ax=None)

Label the xaxis with the default label for r units.

static label_xaxis_rays(ax=None)

Label the yaxis with the default label for rays.

static label_xaxis_time(ax=None)

Label the yaxis with the default label for rays.

label_xaxis_x(self, ax=None)

Label the xaxis with the default label for x units.

label_yaxis_field(self, field, ax=None)

Label the yaxis with the default label for a field units.

label_yaxis_y(self, ax=None)

Label the yaxis with the default label for y units.

label_yaxis_z(self, ax=None)

Label the yaxis with the default label for z units.

plot(self, field, sweep=0, **kwargs)

Create a plot appropiate for the radar.

This function calls the plotting function corresponding to the scan_type of the radar. Additional keywords can be passed to customize the plot, see the appropiate plot function for the allowed keywords.

Parameters:
field : str

Field to plot.

sweep : int

Sweep number to plot, not used for VPT scans.

See also

plot_ppi
Plot a PPI scan
plot_rhi
Plot a RHI scan
plot_vpt
Plot a VPT scan
plot_azimuth_to_rhi(self, field, target_azimuth, mask_tuple=None, vmin=None, vmax=None, norm=None, cmap=None, mask_outside=False, title=None, title_flag=True, axislabels=(None, None), axislabels_flag=True, colorbar_flag=True, colorbar_label=None, colorbar_orient='vertical', edges=True, gatefilter=None, reverse_xaxis=None, filter_transitions=True, ax=None, fig=None, ticks=None, ticklabs=None, raster=False, **kwargs)

Plot pseudo-RHI scan by extracting the vertical field associated with the given azimuth.

Additional arguments are passed to Matplotlib’s pcolormesh function.

Parameters:
field : str

Field to plot.

target_azimuth : integer

Azimuthal angle in degrees where cross section will be taken.

Other Parameters:
 
mask_tuple : (str, float)

2-Tuple containing the field name and value below which to mask field prior to plotting, for example to mask all data where NCP < 0.5 set mask to [‘NCP’, 0.5]. None performs no masking.

vmin : float

Luminance minimum value, None for default value. Parameter is ignored is norm is not None.

vmax : float

Luminance maximum value, None for default value. Parameter is ignored is norm is not None.

norm : Normalize or None, optional

matplotlib Normalize instance used to scale luminance data. If not None the vmax and vmin parameters are ignored. If None, vmin and vmax are used for luminance scaling.

cmap : str or None

Matplotlib colormap name. None will use the default colormap for the field being plotted as specified by the Py-ART configuration.

title : str

Title to label plot with, None to use default title generated from the field and sweep parameters. Parameter is ignored if title_flag is False.

title_flag : bool

True to add a title to the plot, False does not add a title.

axislabels : (str, str)

2-tuple of x-axis, y-axis labels. None for either label will use the default axis label. Parameter is ignored if axislabels_flag is False.

axislabels_flag : bool

True to add label the axes, False does not label the axes.

reverse_xaxis : bool or None

True to reverse the x-axis so the plot reads east to west, False to have east to west. None (the default) will reverse the axis only when all the distances are negative.

colorbar_flag : bool

True to add a colorbar with label to the axis. False leaves off the colorbar.

colorbar_label : str

Colorbar label, None will use a default label generated from the field information.

ticks : array

Colorbar custom tick label locations.

ticklabs : array

Colorbar custom tick labels.

colorbar_orient : ‘vertical’ or ‘horizontal’

Colorbar orientation.

edges : bool

True will interpolate and extrapolate the gate edges from the range, azimuth and elevations in the radar, treating these as specifying the center of each gate. False treats these coordinates themselves as the gate edges, resulting in a plot in which the last gate in each ray and the entire last ray are not not plotted.

gatefilter : GateFilter

GateFilter instance. None will result in no gatefilter mask being applied to data.

filter_transitions : bool

True to remove rays where the antenna was in transition between sweeps from the plot. False will include these rays in the plot. No rays are filtered when the antenna_transition attribute of the underlying radar is not present.

ax : Axis

Axis to plot on. None will use the current axis.

fig : Figure

Figure to add the colorbar to. None will use the current figure.

raster : bool

False by default. Set to True to render the display as a raster rather than a vector in call to pcolormesh. Saves time in plotting high resolution data over large areas. Be sure to set the dpi of the plot for your application if you save it as a vector format (i.e., pdf, eps, svg).

plot_colorbar(self, mappable=None, field=None, label=None, orient='vertical', cax=None, ax=None, fig=None, ticks=None, ticklabs=None)

Plot a colorbar.

Parameters:
mappable : Image, ContourSet, etc.

Image, ContourSet, etc to which the colorbar applied. If None the last mappable object will be used.

field : str

Field to label colorbar with.

label : str

Colorbar label. None will use a default value from the last field plotted.

orient : str

Colorbar orientation, either ‘vertical’ [default] or ‘horizontal’.

cax : Axis

Axis onto which the colorbar will be drawn. None is also valid.

ax : Axes

Axis onto which the colorbar will be drawn. None is also valid.

fig : Figure

Figure to place colorbar on. None will use the current figure.

ticks : array

Colorbar custom tick label locations.

ticklabs : array

Colorbar custom tick labels.

static plot_cross_hair(size, npts=100, ax=None)

Plot a cross-hair on a ppi plot.

Parameters:
size : float

Size of cross-hair in km.

npts: int

Number of points in the cross-hair, higher for better resolution.

ax : Axis

Axis to plot on. None will use the current axis.

static plot_grid_lines(ax=None, col='k', ls=':')

Plot grid lines.

Parameters:
ax : Axis

Axis to plot on. None will use the current axis.

col : str or value

Color to use for grid lines.

ls : str

Linestyle to use for grid lines.

plot_label(self, label, location, symbol='r+', text_color='k', ax=None)

Plot a single symbol and label at a given location.

Transforms of the symbol location in latitude and longitude units to x and y plot units is performed using an azimuthal equidistance map projection centered at the radar.

Parameters:
label : str

Label text to place just above symbol.

location : 2-tuples

Tuple of latitude, longitude (in degrees) at which the symbol will be place. The label is placed just above the symbol.

symbol : str

Matplotlib color+marker strings defining the symbol to place at the given location.

text_color : str

Matplotlib color defining the color of the label text.

ax : Axis

Axis to plot on. None will use the current axis.

plot_labels(self, labels, locations, symbols='r+', text_color='k', ax=None)

Plot symbols and labels at given locations.

Parameters:
labels : list of str

List of labels to place just above symbols.

locations : list of 2-tuples

List of latitude, longitude (in degrees) tuples at which symbols will be place. Labels are placed just above the symbols.

symbols : list of str or str

List of matplotlib color+marker strings defining symbols to place at given locations. If a single string is provided, that symbol will be placed at all locations.

text_color : str

Matplotlib color defining the color of the label text.

ax : Axis

Axis to plot on. None will use the current axis.

plot_line_geo(self, line_lons, line_lats, line_style='r-', **kwargs)[source]

Plot a line segments on the current map given values in lat and lon.

Additional arguments are passed to basemap.plot.

Parameters:
line_lons : array

Longitude of line segment to plot.

line_lats : array

Latitude of line segment to plot.

line_style : str

Matplotlib compatible string which specifies the line style.

plot_line_xy(self, line_x, line_y, line_style='r-', **kwargs)[source]

Plot a line segments on the current map given radar x, y values.

Additional arguments are passed to basemap.plot.

Parameters:
line_x : array

X location of points to plot in meters from the radar.

line_y : array

Y location of points to plot in meters from the radar.

line_style : str, optional

Matplotlib compatible string which specifies the line style.

plot_point(self, lon, lat, symbol='ro', label_text=None, label_offset=(None, None), **kwargs)[source]

Plot a point on the current map.

Additional arguments are passed to basemap.plot.

Parameters:
lon : float

Longitude of point to plot.

lat : float

Latitude of point to plot.

symbol : str

Matplotlib compatible string which specified the symbol of the point.

label_text : str, optional.

Text to label symbol with. If None no label will be added.

label_offset : [float, float]

Offset in lon, lat degrees for the bottom left corner of the label text relative to the point. A value of None will use 0.01 de

plot_ppi(self, field, sweep=0, mask_tuple=None, vmin=None, vmax=None, norm=None, cmap=None, mask_outside=False, title=None, title_flag=True, axislabels=(None, None), axislabels_flag=True, colorbar_flag=True, colorbar_label=None, colorbar_orient='vertical', edges=True, gatefilter=None, filter_transitions=True, ax=None, fig=None, ticks=None, ticklabs=None, raster=False, title_datetime_format=None, title_use_sweep_time=True, **kwargs)

Plot a PPI.

Additional arguments are passed to Matplotlib’s pcolormesh function.

Parameters:
field : str

Field to plot.

sweep : int, optional

Sweep number to plot.

Other Parameters:
 
mask_tuple : (str, float)

Tuple containing the field name and value below which to mask field prior to plotting, for example to mask all data where NCP < 0.5 set mask_tuple to [‘NCP’, 0.5]. None performs no masking.

vmin : float

Luminance minimum value, None for default value. Parameter is ignored is norm is not None.

vmax : float

Luminance maximum value, None for default value. Parameter is ignored is norm is not None.

norm : Normalize or None, optional

matplotlib Normalize instance used to scale luminance data. If not None the vmax and vmin parameters are ignored. If None, vmin and vmax are used for luminance scaling.

cmap : str or None

Matplotlib colormap name. None will use the default colormap for the field being plotted as specified by the Py-ART configuration.

mask_outside : bool

True to mask data outside of vmin, vmax. False performs no masking.

title : str

Title to label plot with, None to use default title generated from the field and sweep parameters. Parameter is ignored if title_flag is False.

title_datetime_format : str

Format of datetime in the title (using strftime format).

title_use_sweep_time : bool

True for the current sweep’s beginning time to be used for the title. False for the radar’s beginning time.

title_flag : bool

True to add a title to the plot, False does not add a title.

axislabels : (str, str)

2-tuple of x-axis, y-axis labels. None for either label will use the default axis label. Parameter is ignored if axislabels_flag is False.

axislabels_flag : bool

True to add label the axes, False does not label the axes.

colorbar_flag : bool

True to add a colorbar with label to the axis. False leaves off the colorbar.

colorbar_label : str

Colorbar label, None will use a default label generated from the field information.

colorbar_orient : ‘vertical’ or ‘horizontal’

Colorbar orientation.

ticks : array

Colorbar custom tick label locations.

ticklabs : array

Colorbar custom tick labels.

edges : bool

True will interpolate and extrapolate the gate edges from the range, azimuth and elevations in the radar, treating these as specifying the center of each gate. False treats these coordinates themselves as the gate edges, resulting in a plot in which the last gate in each ray and the entire last ray are not plotted.

gatefilter : GateFilter

GateFilter instance. None will result in no gatefilter mask being applied to data.

filter_transitions : bool

True to remove rays where the antenna was in transition between sweeps from the plot. False will include these rays in the plot. No rays are filtered when the antenna_transition attribute of the underlying radar is not present.

ax : Axis

Axis to plot on. None will use the current axis.

fig : Figure

Figure to add the colorbar to. None will use the current figure.

raster : bool

False by default. Set to true to render the display as a raster rather than a vector in call to pcolormesh. Saves time in plotting high resolution data over large areas. Be sure to set the dpi of the plot for your application if you save it as a vector format (i.e., pdf, eps, svg).

plot_ppi_map(self, field, sweep=0, mask_tuple=None, vmin=None, vmax=None, cmap=None, norm=None, mask_outside=False, title=None, title_flag=True, colorbar_flag=True, colorbar_label=None, ax=None, fig=None, lat_lines=None, lon_lines=None, projection='lcc', area_thresh=10000, min_lon=None, max_lon=None, min_lat=None, max_lat=None, width=None, height=None, lon_0=None, lat_0=None, resolution='h', shapefile=None, edges=True, gatefilter=None, basemap=None, filter_transitions=True, embelish=True, ticks=None, ticklabs=None, raster=False, alpha=None, **kwargs)[source]

Plot a PPI volume sweep onto a geographic map.

Additional arguments are passed to Basemap.

Parameters:
field : str

Field to plot.

sweep : int, optional

Sweep number to plot.

Other Parameters:
 
mask_tuple : (str, float)

Tuple containing the field name and value below which to mask field prior to plotting, for example to mask all data where NCP < 0.5 set mask_tuple to [‘NCP’, 0.5]. None performs no masking.

vmin : float

Luminance minimum value, None for default value. Parameter is ignored is norm is not None.

vmax : float

Luminance maximum value, None for default value. Parameter is ignored is norm is not None.

norm : Normalize or None, optional

matplotlib Normalize instance used to scale luminance data. If not None the vmax and vmin parameters are ignored. If None, vmin and vmax are used for luminance scaling.

cmap : str or None

Matplotlib colormap name. None will use the default colormap for the field being plotted as specified by the Py-ART configuration.

mask_outside : bool

True to mask data outside of vmin, vmax. False performs no masking.

title : str

Title to label plot with, None to use default title generated from the field and tilt parameters. Parameter is ignored if title_flag is False.

title_flag : bool

True to add a title to the plot, False does not add a title.

colorbar_flag : bool

True to add a colorbar with label to the axis. False leaves off the colorbar.

ticks : array

Colorbar custom tick label locations.

ticklabs : array

Colorbar custom tick labels.

colorbar_label : str

Colorbar label, None will use a default label generated from the field information.

ax : Axis

Axis to plot on. None will use the current axis.

fig : Figure

Figure to add the colorbar to. None will use the current figure.

lat_lines, lon_lines : array or None

Locations at which to draw latitude and longitude lines. None will use default values which are resonable for maps of North America.

projection : str

Map projection supported by basemap. The use of cylindrical projections (mill, merc, etc) is not recommended as they exhibit large distortions at high latitudes. Equal area (aea, laea), conformal (lcc, tmerc, stere) or equidistant projection (aeqd, cass) work well even at high latitudes. The cylindrical equidistant projection (cyl) is not supported as coordinate transformations cannot be performed.

area_thresh : float

Coastline or lake with an area smaller than area_thresh in km^2 will not be plotted.

min_lat, max_lat, min_lon, max_lon : float

Latitude and longitude ranges for the map projection region in degrees.

width, height : float

Width and height of map domain in meters. Only this set of parameters or the previous set of parameters (min_lat, max_lat, min_lon, max_lon) should be specified. If neither set is specified then the map domain will be determined from the extend of the radar gate locations.

lon_0, lat_0 : float

Center of the map domain in degrees. If the default, None is used the latitude and longitude of the radar will be used.

shapefile : str

Filename for a ESRI shapefile as background (untested).

resolution : ‘c’, ‘l’, ‘i’, ‘h’, or ‘f’.

Resolution of boundary database to use. See Basemap documentation for details.

gatefilter : GateFilter

GateFilter instance. None will result in no gatefilter mask being applied to data.

filter_transitions : bool

True to remove rays where the antenna was in transition between sweeps from the plot. False will include these rays in the plot. No rays are filtered when the antenna_transition attribute of the underlying radar is not present.

edges : bool

True will interpolate and extrapolate the gate edges from the range, azimuth and elevations in the radar, treating these as specifying the center of each gate. False treats these coordinates themselved as the gate edges, resulting in a plot in which the last gate in each ray and the entire last ray are not not plotted.

embelish: bool

True by default. Set to false to supress drawing of coastlines etc.. Use for speedup when specifying shapefiles.

basemap: Basemap instance

If None, create basemap instance using other keyword info. If not None, use the user-specifed basemap instance.

raster : bool

False by default. Set to true to render the display as a raster rather than a vector in call to pcolormesh. Saves time in plotting high resolution data over large areas. Be sure to set the dpi of the plot for your application if you save it as a vector format (i.e., pdf, eps, svg).

alpha : float or None

Set the alpha tranparency of the radar plot. Useful for overplotting radar over other datasets.

plot_range_ring(self, range_ring_location_km, npts=360, line_style='k-', **kwargs)[source]

Plot a single range ring on the map.

Additional arguments are passed to basemap.plot.

Parameters:
range_ring_location_km : float

Location of range ring in km.

npts: int

Number of points in the ring, higher for better resolution.

line_style : str

Matplotlib compatible string which specified the line style of the ring.

plot_range_rings(self, range_rings, ax=None, col='k', ls='-', lw=2)

Plot a series of range rings.

Parameters:
range_rings : list

List of locations in km to draw range rings.

ax : Axis

Axis to plot on. None will use the current axis.

col : str or value

Color to use for range rings.

ls : str

Linestyle to use for range rings.

plot_ray(self, field, ray, format_str='k-', mask_tuple=None, ray_min=None, ray_max=None, mask_outside=False, title=None, title_flag=True, axislabels=(None, None), gatefilter=None, axislabels_flag=True, ax=None, fig=None)

Plot a single ray.

Parameters:
field : str

Field to plot.

ray : int

Ray number to plot.

Other Parameters:
 
format_str : str

Format string defining the line style and marker.

mask_tuple : (str, float)

Tuple containing the field name and value below which to mask field prior to plotting, for example to mask all data where NCP < 0.5 set mask_tuple to [‘NCP’, 0.5]. None performs no masking.

ray_min : float

Minimum ray value, None for default value, ignored if mask_outside is False.

ray_max : float

Maximum ray value, None for default value, ignored if mask_outside is False.

mask_outside : bool

True to mask data outside of vmin, vmax. False performs no masking.

title : str

Title to label plot with, None to use default title generated from the field and ray parameters. Parameter is ignored if title_flag is False.

title_flag : bool

True to add a title to the plot, False does not add a title.

gatefilter : GateFilter

GateFilter instance. None will result in no gatefilter mask being applied to data.

axislabels : (str, str)

2-tuple of x-axis, y-axis labels. None for either label will use the default axis label. Parameter is ignored if axislabels_flag is False.

axislabels_flag : bool

True to add label the axes, False does not label the axes.

ax : Axis

Axis to plot on. None will use the current axis.

fig : Figure

Figure to add the colorbar to. None will use the current figure.

plot_rhi(self, field, sweep=0, mask_tuple=None, vmin=None, vmax=None, norm=None, cmap=None, mask_outside=False, title=None, title_flag=True, axislabels=(None, None), axislabels_flag=True, reverse_xaxis=None, colorbar_flag=True, colorbar_label=None, colorbar_orient='vertical', edges=True, gatefilter=None, filter_transitions=True, ax=None, fig=None, ticks=None, ticklabs=None, raster=False, title_datetime_format=None, title_use_sweep_time=True, **kwargs)

Plot a RHI.

Additional arguments are passed to Matplotlib’s pcolormesh function.

Parameters:
field : str

Field to plot.

sweep : int,

Sweep number to plot.

Other Parameters:
 
mask_tuple : (str, float)

2-Tuple containing the field name and value below which to mask field prior to plotting, for example to mask all data where NCP < 0.5 set mask to [‘NCP’, 0.5]. None performs no masking.

vmin : float

Luminance minimum value, None for default value. Parameter is ignored is norm is not None.

vmax : float

Luminance maximum value, None for default value. Parameter is ignored is norm is not None.

norm : Normalize or None, optional

matplotlib Normalize instance used to scale luminance data. If not None the vmax and vmin parameters are ignored. If None, vmin and vmax are used for luminance scaling.

cmap : str or None

Matplotlib colormap name. None will use the default colormap for the field being plotted as specified by the Py-ART configuration.

title : str

Title to label plot with, None to use default title generated from the field and sweep parameters. Parameter is ignored if title_flag is False.

title_datetime_format : str

Format of datetime in the title (using strftime format).

title_use_sweep_time : bool

True for the current sweep’s beginning time to be used for the title. False for the radar’s beginning time.

title_flag : bool

True to add a title to the plot, False does not add a title.

axislabels : (str, str)

2-tuple of x-axis, y-axis labels. None for either label will use the default axis label. Parameter is ignored if axislabels_flag is False.

axislabels_flag : bool

True to add label the axes, False does not label the axes.

reverse_xaxis : bool or None

True to reverse the x-axis so the plot reads west to east, False to have east to west. None (the default) will reverse the axis only when all the distances are negative. (i.e) axis will be absolute distance without taking into consideration the orientation

colorbar_flag : bool

True to add a colorbar with label to the axis. False leaves off the colorbar.

colorbar_label : str

Colorbar label, None will use a default label generated from the field information.

colorbar_orient : ‘vertical’ or ‘horizontal’

Colorbar orientation.

ticks : array

Colorbar custom tick label locations.

ticklabs : array

Colorbar custom tick labels.

edges : bool

True will interpolate and extrapolate the gate edges from the range, azimuth and elevations in the radar, treating these as specifying the center of each gate. False treats these coordinates themselves as the gate edges, resulting in a plot in which the last gate in each ray and the entire last ray are not not plotted.

gatefilter : GateFilter

GateFilter instance. None will result in no gatefilter mask being applied to data.

filter_transitions : bool

True to remove rays where the antenna was in transition between sweeps from the plot. False will include these rays in the plot. No rays are filtered when the antenna_transition attribute of the underlying radar is not present.

ax : Axis

Axis to plot on. None will use the current axis.

fig : Figure

Figure to add the colorbar to. None will use the current figure.

raster : bool

False by default. Set to true to render the display as a raster rather than a vector in call to pcolormesh. Saves time in plotting high resolution data over large areas. Be sure to set the dpi of the plot for your application if you save it as a vector format (i.e., pdf, eps, svg).

plot_vpt(self, field, mask_tuple=None, vmin=None, vmax=None, norm=None, cmap=None, mask_outside=False, title=None, title_flag=True, axislabels=(None, None), axislabels_flag=True, colorbar_flag=True, colorbar_label=None, colorbar_orient='vertical', edges=True, gatefilter=None, filter_transitions=True, time_axis_flag=False, date_time_form=None, tz=None, ax=None, fig=None, ticks=None, ticklabs=None, raster=False, **kwargs)

Plot a VPT scan.

Additional arguments are passed to Matplotlib’s pcolormesh function.

Parameters:
field : str

Field to plot.

Other Parameters:
 
mask_tuple : (str, float)

Tuple containing the field name and value below which to mask field prior to plotting, for example to mask all data where NCP < 0.5 set mask_tuple to [‘NCP’, 0.5]. None performs no masking.

vmin : float

Luminance minimum value, None for default value. Parameter is ignored is norm is not None.

vmax : float

Luminance maximum value, None for default value. Parameter is ignored is norm is not None.

norm : Normalize or None, optional

matplotlib Normalize instance used to scale luminance data. If not None the vmax and vmin parameters are ignored. If None, vmin and vmax are used for luminance scaling.

cmap : str or None

Matplotlib colormap name. None will use the default colormap for the field being plotted as specified by the Py-ART configuration.

mask_outside : bool

True to mask data outside of vmin, vmax. False performs no masking.

title : str

Title to label plot with, None to use default title generated from the field and sweep parameters. Parameter is ignored if title_flag is False.

title_flag : bool

True to add a title to the plot, False does not add a title.

axislabels : (str, str)

2-tuple of x-axis, y-axis labels. None for either label will use the default axis label. Parameter is ignored if axislabels_flag is False.

axislabels_flag : bool

True to add label the axes, False does not label the axes.

colorbar_flag : bool

True to add a colorbar with label to the axis. False leaves off the colorbar.

colorbar_label : str

Colorbar label, None will use a default label generated from the field information.

ticks : array

Colorbar custom tick label locations.

ticklabs : array

Colorbar custom tick labels.

colorbar_orient : ‘vertical’ or ‘horizontal’

Colorbar orientation.

edges : bool

True will interpolate and extrapolate the gate edges from the range, azimuth and elevations in the radar, treating these as specifying the center of each gate. False treats these coordinates themselves as the gate edges, resulting in a plot in which the last gate in each ray and the entire last ray are not not plotted.

gatefilter : GateFilter

GateFilter instance. None will result in no gatefilter mask being applied to data.

filter_transitions : bool

True to remove rays where the antenna was in transition between sweeps from the plot. False will include these rays in the plot. No rays are filtered when the antenna_transition attribute of the underlying radar is not present.

time_axis_flag : bool

True to plot the x-axis as time. False uses the index number. Default is False - index-based.

date_time_form : str, optional

Format of the time string for x-axis labels. Parameter is ignored if time_axis_flag is set to False.

tz : str, optional

Time zone info to use when creating axis labels (see datetime). Parameter is ignored if time_axis_flag is set to False.

ax : Axis

Axis to plot on. None will use the current axis.

fig : Figure

Figure to add the colorbar to. None will use the current figure.

raster : bool

False by default. Set to true to render the display as a raster rather than a vector in call to pcolormesh. Saves time in plotting high resolution data over large areas. Be sure to set the dpi of the plot for your application if you save it as a vector format (i.e., pdf, eps, svg).

static set_aspect_ratio(aspect_ratio=0.75, ax=None)

Set the aspect ratio for plot area.

static set_limits(xlim=None, ylim=None, ax=None)

Set the display limits.

Parameters:
xlim : tuple, optional

2-Tuple containing y-axis limits in km. None uses default limits.

ylim : tuple, optional

2-Tuple containing x-axis limits in km. None uses default limits.

ax : Axis

Axis to adjust. None will adjust the current axis.