pysteps.visualization.precipfields.plot_precip_field

pysteps.visualization.precipfields.plot_precip_field

pysteps.visualization.precipfields.plot_precip_field(precip, ptype='intensity', ax=None, geodata=None, units='mm/h', bbox=None, colorscale='pysteps', probthr=None, title=None, colorbar=True, axis='on', cax=None, map_kwargs=None, **kwargs)

Function to plot a precipitation intensity or probability field with a colorbar.

Parameters
precip: array-like

Two-dimensional array containing the input precipitation field or an exceedance probability map.

ptype: {‘intensity’, ‘depth’, ‘prob’}, optional

Type of the map to plot: ‘intensity’ = precipitation intensity field, ‘depth’ = precipitation depth (accumulation) field, ‘prob’ = exceedance probability field.

geodata: dictionary or None, optional

Optional dictionary containing geographical information about the field. Required is map is not None.

If geodata is not None, it must contain the following key-value pairs:

Key

Value

projection

PROJ.4-compatible projection definition

x1

x-coordinate of the lower-left corner of the data raster

y1

y-coordinate of the lower-left corner of the data raster

x2

x-coordinate of the upper-right corner of the data raster

y2

y-coordinate of the upper-right corner of the data raster

yorigin

a string specifying the location of the first element in the data raster w.r.t. y-axis: ‘upper’ = upper border, ‘lower’ = lower border

units{‘mm/h’, ‘mm’, ‘dBZ’}, optional

Units of the input array. If ptype is ‘prob’, this specifies the unit of the intensity threshold.

bboxtuple, optional

Four-element tuple specifying the coordinates of the bounding box. Use this for plotting a subdomain inside the input grid. The coordinates are of the form (lower left x, lower left y ,upper right x, upper right y). If ‘geodata’ is not None, the bbox is in map coordinates, otherwise it represents image pixels.

colorscale{‘pysteps’, ‘STEPS-BE’, ‘BOM-RF3’}, optional

Which colorscale to use. Applicable if units is ‘mm/h’, ‘mm’ or ‘dBZ’.

probthrfloat, optional

Intensity threshold to show in the color bar of the exceedance probability map. Required if ptype is “prob” and colorbar is True.

titlestr, optional

If not None, print the title on top of the plot.

colorbarbool, optional

If set to True, add a colorbar on the right side of the plot.

axis{‘off’,’on’}, optional

Whether to turn off or on the x and y axis.

caxAxes object, optional

Axes into which the colorbar will be drawn. If no axes is provided the colorbar axes are created next to the plot.

Returns
axfig Axes

Figure axes. Needed if one wants to add e.g. text inside the plot.

Other Parameters
map_kwargs: dict

Optional parameters that need to be passed to pysteps.visualization.basemaps.plot_geography().