Atmosphere Virtual Lab
A toolkit for interactive plotting of atmospheric data.
Given a Harp product and variable name, it extracts data as well as meta-data to automatically produce an annotated data trace.
The following types of data traces are currently supported:
There are three types of plots that can also be individually instantiated, and populated with (compatible) data traces:
Data traces are in themselves also plots (with a single data trace), so can be shown interactively without requiring a separate plot.
Example usage:
avl.Scatter(product, 'variable name')
Additional keyword arguments are passed to the underlying plot:
avl.Geo(product, 'var1', centerlat=90)
Combining data traces:
plot = avl.MapPlot()
plot.add(avl.Geo(product, 'var1'))
plot.add(avl.Geo(product, 'var2'))
plot
def download(files, target_directory=".")
Download file(s) from atmospherevirtuallab.org
, skipping files
that already exist.
Arguments:
files
- file name or list/tuple of file namestarget_directory
- path where to store files (default ‘.’)def Volume(product, value, **kwargs)
Return a Volume data trace for the given Harp variable.
Nan-values are converted to the lowest non-nan value.
Volume data traces cannot currently be combined in a single plot!
Arguments:
product
- Harp productvalue
- Harp variable namespherical
- Project data to a sphere (default False)def Histogram(product, value, **kwargs)
Return a Histogram data trace for the given Harp variable.
Compatible plot type: Plot
Arguments:
product
- Harp productvalue
- Harp variable namebins
- Number of binsdef Scatter(product, value, **kwargs)
Return a Scatter data trace for the given Harp variable.
Compatible plot type: Plot
Arguments:
product
- Harp productvalue
- Harp variable namedef Line(product, value, **kwargs)
Return a Line data trace for the given Harp variable.
Compatible plot type: Plot
Arguments:
product
- Harp productvalue
- Harp variable namedef Heatmap(product, value, **kwargs)
Return a Heatmap data trace for the given Harp variable.
Compatible plot type: Plot
Arguments:
product
- Harp productvalue
- Harp variable namecolormap
- Colormap name (matplotlib) or list of (r,g,b), (r,g,b,a)
or (x,r,g,b,a) values (ranging from 0..1)gap_threshold
- Add gaps when larger (np.timedelta, default 24h)def Geo(product, value, colormap='viridis', colorrange=None, opacity=0.6, pointsize=2, **kwargs)
Return a Geo data trace for the given Harp variable.
Compatible plot type: MapPlot
Arguments:
product
- Harp productvalue
- Harp variable namecolormap
- Colormap name (matplotlib) or list of (x,r,g,b,a) values (0..1)colorrange
- Color range to use (default min, max of data)opacity
- Opacity (default 0.6)pointsize
- Point size (for point data)def Geo3D(product, value, colormap='viridis', colorrange=None, heightfactor=None, opacity=0.6, pointsize=None, showcolorbar=True, **kwargs)
Return a Geo3D data trace for the given Harp variable.
Compatible plot type: MapPlot3D
Arguments:
product
- Harp productvalue
- Harp variable namecolormap
- Colormap name (matplotlib) or list of (r,g,b), (r,g,b,a)
or (x,r,g,b,a) values (ranging from 0..1)colorrange
- Color range to use (default min, max of data)heightfactor
- Scale heightopacity
- Opacity (default 0.6)pointsize
- Point sizeshowcolorbar
- Show colorbar (default True)class Plot()
2D Plot type
def add(obj)
Add data trace of the same plot type.
Arguments:
obj
- Data traceclass MapPlot()
2D Map Plot type
def __init__(centerlat=0.0, centerlon=0.0, size=(800, 400), zoom=1, colormaps=None, **kwargs)
Arguments:
centerlon
- Center longitude (default 0)centerlat
- Center latitude (default 0)colormaps
- List of colormaps to use, with each in one of three forms:
size
- Plot size in pixels (default (640, 480))zoom
- Zoom factordef add(obj)
Add data trace of the same plot type.
Arguments:
obj
- Data traceclass MapPlot3D()
3D Map Plot type
def __init__(showcolorbar=True, colorrange=None, size=(640, 480), centerlon=0, centerlat=0, opacity=0.6, pointsize=None, heightfactor=None, zoom=None, colormap=None, **kwargs)
Arguments:
centerlon
- Center longitude (default 0)centerlat
- Center latitude (default 0)size
- Plot size in pixels (default (640, 480))zoom
- Zoom factordef add(obj)
Add data trace of the same plot type.
Arguments:
obj
- Data trace