trajan.animation

Attributes

logger

Classes

Plot

Animation

Package Contents

class trajan.animation.Plot(ds)[source]
ds: xarray.Dataset
gcrs = None
DEFAULT_LINE_COLOR = 'gray'
property __cartesian__
set_up_map(kwargs_d=None, **kwargs)[source]

Set up axes for plotting.

Args:

crs: Use a different crs than Mercator.

margin: margin (decimal degrees) in addition to extent of trajectories.

land: Add land shapes based on GSHHG to map.

‘auto’ (default): use automatic scaling.

‘c’, ‘l’,’i’,’h’,’f’ or ‘coarse’, ‘low’, ‘intermediate’, ‘high’, ‘full’: use corresponding GSHHG level.

‘mask’ or ‘fast’ (fastest): use a raster mask generated from GSHHG.

None: do not add land shapes.

Returns:

An matplotlib axes with a Cartopy projection.

__call__(*args, **kwargs)[source]
lines(*args, **kwargs)[source]

Plot the trajectory lines.

Args:

ax: Use existing axes, otherwise a new one is set up.

crs: Specify crs for new axis.

Returns:

Matplotlib lines, and axes.

scatter(*args, **kwargs)[source]

Plot the particles as points.

Args:

ax: Use existing axes, otherwise a new one is set up.

crs: Specify crs for new axis.

Returns:

Matplotlib lines, and axes.

convex_hull(*args, **kwargs)[source]

Plot the convex hull around all particles

Args:

ax: Use existing axes, otherwise a new one is set up.

crs: Specify crs for new axis.

Returns:

Matplotlib lines, and axes.

trajan.animation.logger
class trajan.animation.Animation(ds)[source]
ds: xarray.Dataset
gcrs = None
DEFAULT_LINE_COLOR
__call__(*args, **kwargs)[source]
animate(*args, **kwargs)[source]
plot_frame(ax, ds, frame)[source]