pysteps.visualization.utils.get_basemap_axis

pysteps.visualization.utils.get_basemap_axis#

pysteps.visualization.utils.get_basemap_axis(extent, geodata=None, ax=None, map_kwargs=None)#

Safely get a basemap axis. If ax is None, the current axis is returned.

If geodata is not None and ax is not a cartopy axis already, it creates a basemap axis and return it.

Parameters:
  • extent (tuple) – Four-element tuple specifying the extent of the domain according to (lower left x, upper right x, lower left y, upper right y).

  • geodata

    geodata: dictionary or None Optional dictionary containing geographical information about the field.

    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

  • ax (axis object) – Optional axis object to use for plotting.

  • map_kwargs (dict) – Optional parameters that need to be passed to pysteps.visualization.basemaps.plot_geography().

Returns:

ax

Return type:

axis object