# chama.graphics module¶

The graphics module contains graphic functions.

Contents

 signal_convexhull(signal, scenarios, threshold) Plots of the signal’s 3D convex hull. signal_xsection(signal, signal_name[, …]) Plots x-y, x-z, and y-z cross sections. animate_puffs(puff[, x_range, y_range]) Plots the horizontal movement of puffs from a GaussianPuff simulation over time. sensor_locations(sensors[, x_range, …]) Plots sensor locations.
chama.graphics.signal_convexhull(signal, scenarios, threshold, timesteps=None, colormap=<matplotlib.colors.ListedColormap object>, x_range=(None, None), y_range=(None, None), z_range=(None, None))[source]

Plots of the signal’s 3D convex hull.

Parameters
• signal (pandas DataFrame) – Signal data from the simulation. The DataFrame contains columns ‘X’, ‘Y’, ‘Z’, ‘T’, and one column for each scenario.

• scenarios (list) – Column names for the scenarios to be plotted

• threshold (float) – The minimum value of the signal to be included

• timesteps (list (optional)) – List of the time steps to include in the plot

• colormap (matplotlib.pyplot ColorMap (optional)) – A ColorMap object sent to the contourf function

• x_range (tuple (optional)) – The x-axis limits for the plot

• y_range (tuple (optional)) – The y-axis limits for the plot

• z_range (tuple (optional)) – The z-axis limits for the plot

chama.graphics.signal_xsection(signal, signal_name, threshold=None, timesteps=None, x_value=None, y_value=None, z_value=None, log_flag=False, colormap=<matplotlib.colors.ListedColormap object>, alpha=0.7, N=5, x_range=(None, None), y_range=(None, None), z_range=(None, None))[source]

Plots x-y, x-z, and y-z cross sections. The signal is summed over all desired time steps and summed across the axis not included in the plot unless a value for the third access is specified.

Parameters
• signal (pandas DataFrame) – Signal data from the simulation. The DataFrame contains columns ‘X’, ‘Y’, ‘Z’, ‘T’, and one column for each scenario.

• signal_name (string) – Column name for the signal to be plotted

• threshold (float (optional)) – The minimum value of the signal to be plotted

• timesteps (list (optional)) – List of the time steps to include in the plot

• x_value (list (optional)) – List of the x locations to include in the plot

• y_value (list (optional)) – List of the y locations to include in the plot

• z_value (list (optional)) – List of the z locations to include in the plot

• log_flag (boolean (optional)) – Flag specifying whether the signal should be plotted on a log scale

• colormap (matplotlib.pyplot ColorMap (optional)) – A ColorMap object sent to the contourf function

• alpha (float (optional)) – Value between 0 and 1 representing the alpha blending value passed to the contourf function

• N (int (optional)) – The number of levels to include in the plot, passed to the contourf function

• x_range (tuple (optional)) – The x-axis limits for the plot

• y_range (tuple (optional)) – The y-axis limits for the plot

• z_range (tuple (optional)) – The z-axis limits for the plot

chama.graphics.animate_puffs(puff, x_range=None, None, y_range=None, None)[source]

Plots the horizontal movement of puffs from a GaussianPuff simulation over time. Each puff is represented as a circle centered at the puff center location with radius equal to the standard deviation in the horizontal direction (sigmaY).

Parameters
• puff (pandas DataFrame) – The puff DataFrame created by a GaussianPuff object

• x_range (tuple (xmin, xmax) (optional)) – The x-axis limits for the plot

• y_range (tuple (ymin, ymax) (optional)) – The y-axis limits for the plot

chama.graphics.sensor_locations(sensors, x_range=None, None, y_range=None, None, z_range=None, None, legend=False, colors=None, markers=None)[source]

Plots sensor locations.

Parameters
• sensors (dict) – A dictionary of sensors with key:value pairs containing {‘sensor name’: chama Sensor object}

• x_range (tuple (optional)) – The x-axis limits for the plot

• y_range (tuple (optional)) – The y-axis limits for the plot

• z_range (tuple (optional)) – The z-axis limits for the plot

• legend (Boolean (optional)) – Indicates if legend should be added to the plot

• colors (dict (optional)) – A dictionary containing the color string to be used when plotting each sensor. The key:value pairs are {‘sensor name’ : String representing the color to be passed to the plot function)

• markers (dict (optional)) – A dictionary containing the marker to be used when plotting each sensor. The key:value pairs are {‘sensor name’ : String representing the marker to be passed to the plot function)