eradiate.tutorials

Extensions and helpers for tutorials.

eradiate.tutorials.load_ipython_extension(ipython)[source]

IPython extension for Eradiate tutorials. Should be loaded at the top of the tutorial notebook.

It sets the Matplotlib style and prints the current date and Eradiate version as markdown.

Notes

This extension should be loaded using the IPython magic:

%load_ext eradiate.tutorials
eradiate.tutorials.plot_polarfilm(da, levels=16, show_contour=True, show_azimuth=False, figsize=(3, 3), azimuth_convention=None, vmin=None, vmax=None, theta_max=90.0)[source]

Plot film data generated by a hemispherical distant sensor as a polar contour plot.

Parameters:
  • da (xarray.DataArray) – Data array to be plotted.

  • levels (int or array-like, default: 16) – Number of levels on the contour plot.

  • show_contour (bool, default: True) – If True, show contour outlines.

  • show_azimuth (bool, default: False) – [Debug option] If True, show azimuth values as points.

  • figsize (tuple, default: (3, 3)) – Figure size.

  • azimuth_convention (AzimuthConvention or str, optional) – Azimuth convention of plotted data (will adjust the azimuth of the plot).

  • vmin, vmax (float, optional) – Range of values to plot. If unset, automatically from the data.

  • theta_max (float, default: 90.0) – Maximum value of the azimuth angle on plots.

Returns:

matplotlib.Figure

eradiate.tutorials.plot_sigma_t(*atmospheres, labels=None, altitude_extent=None, si=None, show=True)[source]

Display the extinction coefficient of one or several atmosphere objects for a single spectral context.

Parameters:
  • *atmospheres (AbstractHeterogeneousAtmosphere) – One or several atmosphere objects for which to plot the extinction coefficient.

  • labels (list of strings, optional) – Labels associated with the passed atmosphere objects. If unset, no legend will be added to the plot.

  • altitude_extent (tuple of float) – A (min, max) altitude pair (in km) to which the plot is restricted.

  • si (SpectralIndex, optional) – The spectral index at which the extinction coefficient is evaluated. If unset, a default spectral index is created using SpectralIndex.new().

  • show (bool, optional) – If True, return None and display the plot. Otherwise, return a (Figure, Axes) pair.