viscid.multiplot module

Deal with efficiently making large series of plots

viscid.multiplot.make_multiplot(vfile, plot_func=None, nr_procs=1, time_slice=':', **kwargs)[source]

Make lots of plots

Calls plot_func (or _do_multiplot if plot_func is None) with 2 positional arguments (int, Grid), and all the kwargs given to multiplot.

Grid is determined by vfile.iter_times(time_slice).

plot_func gets additional keyword arguments first_run (bool) and first_run_result (whatever is returned from plot_func by the first call).

This is the function used by the p2d script. It may be useful to you.

Parameters:
  • vfile (VFile, Grid) – Something that has iter_times
  • plot_func (callable) – Function that makes a single plot. It must take an int (index of time slice), a Grid, and any number of keyword argumets. If None, _do_multiplot is used
  • nr_procs (int) – number of parallel processes to farm out plot_func to
  • time_slice (str) – passed to vfile.iter_times()
  • **kwargs – passed as keword aguments to plot_func