You can interact with this notebook online: Launch notebook
[1]:
from numba import config
#config.DISABLE_JIT = True
[ ]:
from tardis.io.configuration.config_reader import Configuration
from tardis.workflows.type_iip_workflow import TypeIIPWorkflow
This notebook uses existing atomic data from the Vogl IIp paper converted to an updated format. It can be found on moria in /storage/group_storage/atom_data/iip_data/
[ ]:
iip_conf = Configuration.from_yaml('iip_config.yml')
The config here is not particularly good or appropriate for a IIp currently. It is mostly to test a pure hydrogen ejecta with continuum processes and non-thermal equilibrium plasma calculations. None of the other values are necessarily appropriate to model a IIp.
MUST BE AT LEAST 2 SHELLSΒΆ
[ ]:
workflow = TypeIIPWorkflow(iip_conf)
[ ]:
import matplotlib.pyplot as plt
import pandas as pd
j_blues_ctardis = pd.read_csv(
"/home/afullard/tardis-chvogl-configs/j_blues_first.csv", index_col=0
)
plt.plot(workflow.plasma_solver.j_blues[0])
plt.plot(j_blues_ctardis.values[0], linestyle="dashed")
[ ]:
workflow.run()
[ ]:
import matplotlib.pyplot as plt
spectrum = workflow.spectrum_solver.spectrum_real_packets
[ ]:
%matplotlib inline
plt.figure(figsize=(10, 6.5))
spectrum.plot(label="Normal packets")
plt.xlim(500, 9000)
plt.title("TARDIS example model spectrum")
plt.xlabel(r"Wavelength [$\AA$]")
plt.ylabel(r"Luminosity density [erg/s/$\AA$]")
plt.legend()
plt.show()
[ ]:
from tardis.visualization import SDECPlotter
import astropy.units as u
plotter = SDECPlotter.from_workflow(workflow)
plotter.generate_plot_mpl(packets_mode="real", packet_wvl_range=[500, 9000] * u.AA)
[ ]:
workflow.transport_state.tracker_last_interaction_df[workflow.transport_state.tracker_last_interaction_df["last_interaction_type"] == "CONTINUUM_PROCESS"]
[ ]:
from tardis.visualization.tools.liv_plot import LIVPlotter
[ ]:
plotter = LIVPlotter.from_workflow(workflow)
plotter.generate_plot_mpl(packets_mode="real")
[ ]: