You can interact with this notebook online: Launch notebook
Simple TARDIS WorkflowΒΆ
The source code for this workflow can be found at: https://github.com/tardis-sn/tardis/blob/master/tardis/workflows/simple_tardis_workflow.py.
This is a lightweight workflow designed for efficiency, particularly for those running large batches of TARDIS simulations. It minimizes saved output and logging information to streamline execution.
[8]:
import matplotlib.pyplot as plt
from tardis.io.configuration.config_reader import Configuration
from tardis.workflows.simple_tardis_workflow import SimpleTARDISWorkflow
[9]:
config = Configuration.from_yaml('../tardis_example.yml')
[ ]:
workflow = SimpleTARDISWorkflow(config)
[ ]:
workflow.run()
[ ]:
spectrum = workflow.spectrum_solver.spectrum_real_packets
spectrum_virtual = workflow.spectrum_solver.spectrum_virtual_packets
spectrum_integrated = workflow.spectrum_solver.spectrum_integrated
[ ]:
%matplotlib inline
plt.figure(figsize=(10, 6.5))
spectrum.plot(label="Normal packets")
spectrum_virtual.plot(label="Virtual packets")
spectrum_integrated.plot(label='Formal integral')
plt.xlim(500, 9000)
plt.title("TARDIS example model spectrum")
plt.xlabel("Wavelength [$\AA$]")
plt.ylabel("Luminosity density [erg/s/$\AA$]")
plt.legend()
plt.show()