pylawr.functions.plot#

pylawr.functions.plot.create_default_plotter(grid_extent=None)[source]#

Create a default plotter with a header, map and colorbar subplot.

Parameters

grid_extent (dict) – Extent of the map subplot

Returns

  • plotter (pylawr.plot.plotter.Plotter or None, optional) – The initialized plotter with default grid slices and set projection for map subplot.

  • clutter (bool, optional) – If a cluttermap should be plotted

pylawr.functions.plot.plot_leaflet(rate, plot_path, grid_extent=None, add_circle=(9.97451, 53.56796, 20000.0), dpi=100)[source]#

This function can be used to plot a rain rate in a leaflet-conform way. The figure will be transparent, and only the rain rate and a possible radar circle is shown on the figure.

Parameters
  • rate (xarray.DataArray) – The rain field with r as unit.

  • plot_path (str) – The created plot will be saved to this plot path.

  • grid_extent (dict) – The minimum extent of the map subplot.

  • add_circle (tuple or None) – The circle specifications: longitude_center, latitude_center, radius, if None there will be no circle.

  • dpi (int) – The pixels per inch resolution of the resulting png.

Returns

plotter – This plotter instance was used to create the plot.

Return type

pylawr.plot.plotter.Plotter

pylawr.functions.plot.plot_rain_clutter(rate, cluttermap, plot_path, title='Hamburg X-Band Radar', radar='HHG', grid_extent=None)[source]#

This function can be used to plot a rain rate. The figure will have a given title, an information box on the top-left with extracted date from given rain rate. Another information box on top-right shows a given radar name and what variable is plotted. The main subplot displays the rain rate as geo-referenced map with given grid and extent. On top of the rain rate is a given cluttermap displayed.

Parameters
  • rate (xarray.DataArray) – The rain field with r as unit.

  • cluttermap (ClutterMap object) – ClutterMap with n clutter

  • plot_path (str) – This path is used to save the figure.

  • title (str) – Title of this figure

  • radar (str) – Radar name

  • grid_extent (dict or None) – Extent of the map subplot

pylawr.functions.plot.plot_rain_rate(rate, plot_path, title='Hamburg X-Band Radar', radar='HHG', grid_extent=None, plotter=None)[source]#

This function can be used to plot a rain rate. The figure will have a given title, an information box on the top-left with extracted date from given rain rate. Another information box on top-right shows a given radar name and what variable is plotted. The main subplot displays the rain rate as geo-referenced map with given grid and extent.

Parameters
  • rate (xarray.DataArray) – The rain field with r as unit.

  • plot_path (str) – This path is used to save the figure.

  • title (str) – Title of this figure

  • radar (str) – Radar name

  • grid_extent (dict) – Extent of the map subplot

  • plotter (pylawr.plot.plotter.Plotter or None) – The plotter to use. If none plotter is given a default plot is created.

pylawr.functions.plot.plot_reflectivity(refl, plot_path, title='Hamburg X-Band Radar', cmap=<matplotlib.colors.LinearSegmentedColormap object>, vmin=0, vmax=70, radar='HHG', grid_extent=None, add_circle=(9.97451, 53.56796, 20000.0))[source]#

This function can be used to plot a reflectivity in dBZ. The figure will have a given title, an information box on the top-left with extracted date from given reflectivity. Another information box on top-right shows a given radar name and what variable is plotted. The main subplot displays the reflectivity as geo-referenced map with given grid and extent. The color of the map is freely selectable.

Parameters
  • refl (xarray.DataArray) – The reflectivity with dBZ as unit.

  • plot_path (str) – This path is used to save the figure.

  • title (str) – Title of this figure

  • radar (str) – Radar name

  • grid_extent (dict) – Extent of the map subplot

  • add_circle (tuple or None) – The circle specifications: longitude_center, latitude_center, radius. If None there will be no circle.

  • cmap (py:class: 'matplotlib.colors.Colormap') – The colormap of the plot

  • vmin (float) – Normalization of the colormap

  • vmax (float) – Normalization of the colormap