pyarts.plots

This module provides functions related to plotting ARTS data.

class pyarts.plots.Info(xscale, xlabel, xfactor)[source]
__init__(xscale, xlabel, xfactor) None[source]
pyarts.plots.all_keys(atm)[source]
pyarts.plots.plot_arts_lookup(lookup, opacity=True, z=None, g=9.80665, r=287.0570048852906, tpert=0, vmrpert=0, pressures=None, cols=3, species=None)[source]

Visualize an ARTS lookup table.

Plots the opacity or the absorption cross sections based on an ARTS lookup table.

Parameters:
  • lookup (pyarts.arts.GasAbsLookup) – ARTS lookup table object.

  • opacity (bool, optional) – Set to False to plot the absorption cross sections.

  • z (ndarray, optional) – Altitude profile. Optional input for opacity calculation. If not given, the layer thicknesses are calculated based on the hypsometric formula.

  • g (float, optional) – Gravity constant. Uses Earth’s gravity by default.

  • r (float, optional) – Gas constant for dry air. Uses constant for Earth by default.

  • tpert (int, optional) – Index of temperature perturbation to plot.

  • vmrpert (int, optional) – Index of vmr perturbation for nonlinear species to plot.

  • pressures (ndarray(int), optional) – Pressure levels to plot. If not given, up to 6 pressure levels are selected.

  • cols (int, optional) – Species to plot per row.

Returns:

Matplotlib Figure and Axes objects.

Return type:

matplotlib.figure.Figure, ndarray(AxesSubplot)

Examples:

from os.path import join, dirname
import matplotlib.pyplot as plt
import pyarts

lookup_file = join(dirname(pyarts.__file__), '../../test/plots/reference',
                   'abs_lookup_small.xml')
fig, ax = pyarts.plots.plot_arts_lookup(pyarts.xml.load(lookup_file))

fig.suptitle('Lookup table opacities')
fig.subplots_adjust(top=0.88)
plt.show()

(Source code, svg, pdf)

_images/pyarts-plots-1.svg
from os.path import join, dirname
import matplotlib.pyplot as plt
import pyarts
from pyarts.arts import ArrayOfArrayOfSpeciesTag, SpeciesTag

lookup_file = join(dirname(pyarts.__file__), '../../test/plots/reference',
                   'abs_lookup_small.xml')
fig, ax = pyarts.plots.plot_arts_lookup(
    pyarts.xml.load(lookup_file),
    species=ArrayOfArrayOfSpeciesTag([[SpeciesTag("N2O")],
                                      [SpeciesTag("O3")]]),
    opacity=False)

fig.suptitle('Lookup table absorption cross sections [m$^2$]')
fig.subplots_adjust(top=0.88)
plt.show()

(Source code, svg, pdf)

_images/pyarts-plots-2.svg
pyarts.plots.plt_info(atm, keys=[])[source]
pyarts.plots.polar_ppath(ppath, planetary_radius=0.0, rscale=1000, figure_kwargs={'dpi': 300}, draw_lat_lon=True, draw_map=True, draw_za_aa=False, select='all', fig=None, axes=None)[source]

Plots a single observation in a polar coordinate system

Use the draw_* variables to select which plots are done

The polar plots’ central point is at the surface of the planet, i.e., at planetary_radius/rscale. The radius of these plots are the scaled down radiuses of the input ppath.pos[0, :] / rscale + planetary_radius/rscale. The default radius value is thus just the altitude in kilometers. If you put, e.g., 6371e3 as the planetary_radius, the radius values will be the radius from the surface to the highest altitude

Note also that longitudes are unwrapped, e.g. a step longer than 180 degrees between Ppath points will wrap around, or rather, create separate entries of the lat-lons.

Parameters:
  • ppath (pyarts.arts.Ppath) – A single propagation path object

  • planetary_radius (float, optional) – See polar_ppath_helper()

  • rscale (float, optional) – See polar_ppath_helper()

  • figure_kwargs (dict, optional) – Arguments to put into plt.figure(). The default is {“dpi”: 300}.

  • draw_lat_lon (bool, optional) – Whether or not latitude and longitude vs radius angles are drawn. Def: True

  • draw_map (bool, optional) – Whether or not latitude and longitude map is drawn. Def: True

  • draw_za_aa (bool, optional) – Whether or not Zenith and Azimuth angles are drawn. Def: False

  • select (str, optional) – Choose to use “all”, “start”, or “end” data from Ppath

  • fig (Figure, optional) – A figure. The default is None, which generates a new figure.

  • axes (A list of five Axes, optional) – A tuple of five axis. The default is None, which generates new axes. The order is [lat, lon, map, za, aa]

Returns:

  • fig (As input) – As input.

  • axes (As input) – As input.

pyarts.plots.polar_ppath_list(ppaths, planetary_radius=0.0, rscale=1000, figure_kwargs={'dpi': 300}, fig=None, axes=None, select='end', show='poslos')[source]

Wraps polar_ppath() for a list of ppaths

This function takes several ppath objects in a list and manipulates them based on the option input to form a new ppath object that only has a valid pos field. This new ppath object is the passed directly to polar_ppath() to plot the polar coordinate and mapping information about pathing

For example, by default, the select argument is “end”, which means that this call would plot the sensor position for each Ppath

Parameters:
  • ppaths (list of pyarts.arts.Ppath) – A list of Ppath (or pyarts.arts.ArrayOfPpath).

  • planetary_radius (float, optional) – See polar_ppath()

  • rscale (float, optional) – See polar_ppath()

  • figure_kwargs (dict, optional) – See polar_ppath()

  • fig (Figure, optional) – See polar_ppath()

  • axes (Axes, optional) – See polar_ppath()

  • select (str, optional) –

    The selection criteria for the positions and line of sights in the ppath list. Default is “end”.

    Options are:

    • ”end” - end_pos and end_los for each Ppath

    • ”start” - start_pos and start_los for each Ppath

    • ”low” - the lowest r’s pos and los for each Ppath

    • ”all” - all pos and los for each Ppath

  • show (str or list, optional) –

    Selects what to show. Default is “poslos” for showing everything.

    Options are:

    • ”pos” - show the position

    • ”los” - show the line of sight

    • ”no_map” - don’t show the map

    The python “in” operator is used to determine what to show, and the triggers are: “pos” to show ppath pos, “los” to show ppath los, and “no_map” to not show the map. Note that for all intents and purposes, “poslos”, “lospos”, [“pos”, “los”], and “lost purpose” will give the exact same result because they all contain “los” and “pos” in a way that “in” will find

Return type:

As polar_ppath().

pyarts.plots.ppvar_atm(atm, path, keys=[], info={})[source]
pyarts.plots.select_atm(atm, keys=[])[source]
pyarts.plots.select_keys(atm, keys)[source]