pyarts.plots
This module provides functions related to plotting ARTS data.
- pyarts.plots.plot_arts_lookup(lookup, opacity=True, z=None, g=9.80665, r=287.0570048905812, 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()
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()
- pyarts.plots.polar_ray_path(ray_path, planetary_radius=0.0, rscale=1000, figure_kwargs={'dpi': 300}, draw_lat_lon=True, draw_map=True, draw_za_aa=False, 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 ray_path[0].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 ray_path points will wrap around, or rather, create separate entries of the lat-lons.
- Parameters:
ray_path (pyarts.arts.ArrayOfPropagationPathPoint) – A single propagation path object
planetary_radius (float, optional) – See
polar_ray_path_helper()
rscale (float, optional) – See
polar_ray_path_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
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.