You can interact with this notebook online: Launch notebook

How to Generate Custom Abundance WidgetΒΆ

This notebook demonstrates how to generate and display Custom Abundance Widget.

First, import CustomAbundanceWidget module from visualization subpackage to create the widget.

[1]:
from tardis.visualization import CustomAbundanceWidget

Initialize the GUIΒΆ

There are four ways to generate the widget. You can generate it from .yml/.csvy configuration files before running any simulation.

Using a YAML fileΒΆ

[2]:
widget = CustomAbundanceWidget.from_yml("tardis_example.yml")
Configuration File /home/runner/.astropy/config/tardis_internal_config.yml does not exist - creating new one from default
CRITICAL:root:
********************************************************************************

TARDIS will download different kinds of data (e.g. atomic) to its data directory /home/runner/Downloads/tardis-data

TARDIS DATA DIRECTORY not specified in /home/runner/.astropy/config/tardis_internal_config.yml:

ASSUMING DEFAULT DATA DIRECTORY /home/runner/Downloads/tardis-data
 YOU CAN CHANGE THIS AT ANY TIME IN /home/runner/.astropy/config/tardis_internal_config.yml

********************************************************************************


WARNING:tardis.io.model.parse_density_configuration:Number of density points larger than number of shells. Assuming inner point irrelevant

Using a CSVY fileΒΆ

[3]:
# widget = CustomAbundanceWidget.from_csvy("demo.csvy")

Alternatively, you can generate the widget after the simulation from a Simulation instance or a saved simulation (HDF file).

Using a Simulation objectΒΆ

[4]:
# sim = run_tardis("tardis_example.yml")
# widget = CustomAbundanceWidget.from_simulation(sim)

Using a HDF fileΒΆ

[5]:
# widget = CustomAbundanceWidget.from_hdf("demo.h5")

Display the GUIΒΆ

No matter which way you use to initialize the widget, you can call .display() to display the GUI easily.

[6]:
widget.display()

The image below is just a screenshot of the GUI for a demonstration purpose. If you want to interact with the GUI, please run the code in the notebook.

Custom Abundance Widget Demo

[ ]: