You can interact with this notebook online: Launch notebook

Setup ExampleΒΆ

We show an example of setting up a TARDIS simulation.

[1]:
# We import the necessary packages
from tardis.io.configuration.config_reader import Configuration
from tardis.simulation import Simulation
from tardis.io.atom_data import download_atom_data

# We download the atomic data needed to run the simulation
download_atom_data('kurucz_cd23_chianti_H_He')
Atomic Data kurucz_cd23_chianti_H_He already exists in /home/runner/Downloads/tardis-data/kurucz_cd23_chianti_H_He.h5. Will not download - override with force_download=True.

We read a configuration as shown here:

[2]:
tardis_config = Configuration.from_yaml('tardis_example.yml')

We create a Simulation object from the configuration using the Simulation.from_config() class method.

[3]:
sim = Simulation.from_config(tardis_config)
sim
Number of density points larger than number of shells. Assuming inner point irrelevant
[3]:
<tardis.simulation.base.Simulation at 0x7f15e32aa390>

When the Simulation object is created, a SimulationState, BasePlasma, and MontecarloTransport object are created and stored as attributes of the Simulation object.

[4]:
sim.simulation_state
[4]:
<tardis.model.base.SimulationState at 0x7f15f9096810>
[5]:
sim.plasma
[5]:
<tardis.plasma.base.BasePlasma at 0x7f15e3ba18e0>
[6]:
sim.transport
[6]:
<tardis.transport.montecarlo.base.MonteCarloTransportSolver at 0x7f15e33831d0>