Meteorographica.precipitation

This module is designed to make plots of precipitation rate, but they are basically just image maps, so the functions can be used for any scalar variable (with appropriate scaling).

It takes a cartopy.mpl.geoaxes.GeoAxes to draw into, and an iris.cube.Cube (with ‘latitude’ and ‘longitude’ dimensions) of data to plot. Then it’s just:

Meteorographica.precipitation.plot(geoaxes,cube,**options)

Three different types of plot are supported:

See examples of use.


Meteorographica.precipitation.plot(ax, pe, **kwargs)[source]

Plot precipitation.

Generic function for plotting precipitation. Use the ‘type’ argument to choose the plot style.

Parameters:
Keyword Arguments:
 
  • type (str) – Style to plot. Default is ‘cmap’, which delegates plotting to plot_cmesh() and at the moment this is the only choice.
  • keyword arguments are passed to the style-specific plotting function. (Other) –

Meteorographica.precipitation.plot_cmesh(ax, pe, **kwargs)[source]

Plots a variable as a colour map.

This is the same as matplotlib.axes.Axes.pcolorfast(), except that it takes an iris.cube.Cube instead of an array of colour values, and its colour defaults are chosen for plots of precipitation rate.

Parameters:
Keyword Arguments:
 
  • raw (bool) – If True, plot the colourmap on the native data resolution. If False (default), regrid the data to the given resolution before plotting.
  • resolution (float) – What lat:lon resolution (in degrees) to interpolate pe.data to before plotting. Defaults to 0.25.
  • scale (float) – This function is tuned for 20CR precip data - rates in Kg*m-2*s-1. For accumulated precip it will be necessary to scale it to an equivalent range. For CERA-20C, try 10. For ERA5, try 10 for enda and 3.6 for oper. Defaults to 1.
  • sqrt (bool) – Heavy precip (tropical) is so much bigger than light precip that it helps a lot to flatten the distribution before plotting. Apply a square-root filter to the data before plotting? Defaults to True.
  • cmap (matplotlib.colors.LinearSegmentedColormap) – Mapping of pe.data to plot colour. Defaults to green semi-transparent.
  • vmin (float) – Data value that is shown as ‘no precip’ (after scaling and filtering). Increase this to show low-previp as zero instead. Defaults to 0.
  • vmax (float) – Data value that is shown as ‘heavy precip - darkest colour’ (after scaling and filtering). Defaults to 0.025 Kg*m-2*s-1.
  • alpha (float) – transparency to plot at, defaults to 1 (opaque).
  • zorder (float) – Standard matplotlib parameter determining which things are plotted on top (high zorder), and which underneath (low zorder), Defaults to 40.
Returns:

See matplotlib.axes.Axes.pcolorfast() - also adds the image to the plot.