2.0.0b10
catchment modelling framework
Loading...
Searching...
No Matches
HillPlot Class Reference

Inherits object.

Detailed Description

Plots a hillslope using colored sheared rectangles for each layer and
arrows (matplotlib.quiver) to show fluxes.

Properties:

 - evalfunction: a function returning the value of a layer to plot. 
   The value should be a float between 0..1 for scaling. 
   The default is: lambda l: l.wetness
 - q_sub:  The matplotlib.Quiver object for subsurface fluxes
 - q_surf: The matplotlib.Quiver object for subsurface fluxes
 - title:  Title of the plot
 - scale:  The scale of q_sub and q_surf

Public Member Functions

 __init__ (self, cells, t, solute=None, cmap=default_color_map)
 
 __call__ (self, t, text='')
 
 get_animator (self, integration)
 

Constructor & Destructor Documentation

◆ __init__()

__init__ ( self,
cells,
t,
solute = None,
cmap = default_color_map )
Creates a new HillPlot on the active figure, showing the state of each layer
 - cells: The a sequence of cmf cells to use in this hill_plot. You can
          use the whole project if you like
 - t:     Current time step. Needed to retrieve the fluxes
 - solute:The solute concentration to show. If None, the wetness of the 
          layer will be shown
 - cmap:  a matplotlib colormap (see module cm) for coloring

Member Function Documentation

◆ __call__()

__call__ ( self,
t,
text = '' )
Updates the hill_plot at time t. You can provide a title for the figure.
If bool(title)==False, t is shown.

◆ get_animator()

get_animator ( self,
integration )
Returns a matplotlib.animation.FuncAnimator object that uses
the integration iteratable to advance your model to animate the HillPlot

Usage example:

>>>p=cmf.project()
>>>solver = cmf.CVodeIntegrator(p, 1e-9)
>>>hp = HillPlot(p, solver.t)
>>>animator = hp.get_animator(solver.run(datetime(2012, 1, 1), datetime(2012, 2, 1), timedelta(hours=1)))

:param integration: An iterable that advances the model and yields the current time
:return: A matplotlib.animation.FuncAnimator