pompy.demos module

Demonstrations of setting up models and visualising outputs.

pompy.demos.set_up_figure(fig_size=(10, 5))[source]

Set up Matplotlib figure with simulation time title text.

Parameters:
  • title_text (string) – Text to set figure title to.
  • fig_size (tuple) – Figure dimensions in inches in order (width, height).
pompy.demos.update_decorator(dt, title, steps_per_frame, models)[source]

Decorator for animation update methods.

pompy.demos.wind_model_demo(dt=0.01, t_max=100, steps_per_frame=20, seed=20181108)[source]

Set up wind model and animate velocity field with quiver plot.

Parameters:
  • dt (float) – Simulation timestep.
  • t_max (float) – End time to simulate to.
  • steps_per_frame (integer) – Number of simulation time steps to perform between animation frames.
  • seed (integer) – Seed for random number generator.
Returns:

  • fig (Figure) – Matplotlib figure object.
  • ax (AxesSubplot) – Matplotlib axis object.
  • anim (FuncAnimation) – Matplotlib animation object.

pompy.demos.plume_model_demo(dt=0.01, t_max=100, steps_per_frame=200, seed=20181108)[source]

Set up plume model and animate puffs overlayed over velocity field.

Puff positions displayed using Matplotlib scatter plot function and velocity field displayed using quiver plot function. plot and quiver functions.

Parameters:
  • dt (float) – Simulation timestep.
  • t_max (float) – End time to simulate to.
  • steps_per_frame (integer) – Number of simulation time steps to perform between animation frames.
  • seed (integer) – Seed for random number generator.
Returns:

  • fig (Figure) – Matplotlib figure object.
  • ax (AxesSubplot) – Matplotlib axis object.
  • anim (FuncAnimation) – Matplotlib animation object.

pompy.demos.conc_point_val_demo(dt=0.01, t_max=5, steps_per_frame=1, x=10.0, y=0.0, seed=20181108)[source]

Set up plume model and animate concentration at a point as time series.

Demonstration of setting up plume model and processing the outputted puff arrays with the ConcentrationPointValueCalculator class, the resulting concentration time course at a point in the odour plume being displayed with the Matplotlib plot function.

Parameters:
  • dt (float) – Simulation timestep.
  • t_max (float) – End time to simulate to.
  • steps_per_frame (integer) – Number of simulation time steps to perform between animation frames.
  • x (float) – x-coordinate of point to measure concentration at.
  • y (float) – y-coordinate of point to measure concentration at.
  • seed (integer) – Seed for random number generator.
Returns:

  • fig (Figure) – Matplotlib figure object.
  • ax (AxesSubplot) – Matplotlib axis object.
  • anim (FuncAnimation) – Matplotlib animation object.

pompy.demos.concentration_array_demo(dt=0.01, t_max=100, steps_per_frame=50, seed=20181108)[source]

Set up plume model and animate concentration fields.

Demonstration of setting up plume model and processing the outputted puff arrays with the ConcentrationArrayGenerator class, the resulting arrays being displayed with the Matplotlib imshow function.

Parameters:
  • dt (float) – Simulation timestep.
  • t_max (float) – End time to simulate to.
  • steps_per_frame (integer) – Number of simulation time steps to perform between animation frames.
  • seed (integer) – Seed for random number generator.
Returns:

  • fig (Figure) – Matplotlib figure object.
  • ax (AxesSubplot) – Matplotlib axis object.
  • anim (FuncAnimation) – Matplotlib animation object.