tardis.visualization.tools.convergence_plot module

Convergence Plots to see the convergence of the simulation in real time.

class tardis.visualization.tools.convergence_plot.ConvergencePlots(iterations, **kwargs)[source]

Bases: object

Create and update convergence plots for visualizing convergence of the simulation.

Parameters:
iterationsint

iteration number

**kwargsdict, optional

Additional keyword arguments. These arguments are defined in the Other Parameters section.

Other Parameters:
plasma_plot_configdict, optional

Dictionary used to override default plot properties of plasma plots.

t_inner_luminosities_configdict, optional

Dictionary used to override default plot properties of the inner boundary temperature and luminosity plots.

plasma_cmapstr, default: ‘jet’, optional

String defining the cmap used in plasma plots.

t_inner_luminosities_colorsstr or list, optional

String defining cmap for luminosity and inner boundary temperature plot. The list can be a list of colors in rgb, hex or css-names format as well.

export_convergence_plotsbool, default: False, optional

If True, plots are displayed again using the notebook_connected renderer. This helps to display the plots in the documentation or in platforms like nbviewer.

Notes

When overriding plot’s configuration using the plasma_plot_config and the t_inner_luminosities_config dictionaries, data related properties are applied equally accross all traces. The dictionary should have a structure like that of plotly.graph_objs.FigureWidget.to_dict(), for more information please see https://plotly.com/python/figure-structure/

build(display_plot=True)[source]

Create empty convergence plots and display them.

Parameters:
display_plotbool, default: True, optional

Displays empty plots.

create_plasma_plot()[source]

Create an empty plasma plot.

create_t_inner_luminosities_plot()[source]

Create an empty t_inner and luminosity plot.

fetch_data(name=None, value=None, item_type=None)[source]

Fetch data from the Simulation class.

Parameters:
namestring

name of the data

valuestring or array

string or an array of quantities

item_typestring

either iterable or value

override_plot_parameters(fig, parameters)[source]

Override default plot properties.

Any property inside the data dictionary is however, applied equally across all traces. This means trace-specific data properties can’t be changed using this function.

Parameters:
figgo.FigureWidget

FigureWidget object to be updated

parametersdict

Dictionary used to update the default plot style.

update(export_convergence_plots=False, last=False)[source]

Update the convergence plots every iteration.

Parameters:
export_convergence_plotsbool, default: False, optional

Displays the convergence plots again using plotly’s notebook_connected renderer. This helps to display the plots in notebooks when shared on platforms like nbviewer. Please see https://plotly.com/python/renderers/ for more information.

lastbool, default: False, optional

True if it’s last iteration.

update_plasma_plots()[source]

Update plasma convergence plots every iteration.

update_t_inner_luminosities_plot()[source]

Update the t_inner and luminosity convergence plots every iteration.

tardis.visualization.tools.convergence_plot.transition_colors(length, name='jet')[source]

Create colorscale for convergence plots, returns a list of colors.

Parameters:
lengthint

The length of the colorscale.

namestring, default: ‘jet’, optional

Name of the colorscale.

Returns:
colors: list