You can interact with this notebook online: Launch notebook

TARDIS High Energy (HE) Workflow

[1]:
from tardis.workflows import tardis_he_workflow
from tardis.io.configuration import config_reader
import astropy.units as u
from tardis.io.atom_data import AtomData
from tardis.io.atom_data import download_atom_data
[ ]:
download_atom_data('kurucz_cd23_chianti_H_He_latest')
atom_data_file = 'kurucz_cd23_chianti_H_He_latest.h5'
atom_data = AtomData.from_hdf(atom_data_file)
WARNING:tardis.io.atom_data.atom_web_download:Atomic Data kurucz_cd23_chianti_H_He already exists in /home/duttaan2/Downloads/tardis-data/kurucz_cd23_chianti_H_He.h5. Will not download - override with force_download=True.
INFO:tardis.io.atom_data.util:
        Atom Data kurucz_cd23_chianti_H_He.h5 not found in local path.
        Exists in TARDIS Data repo /home/duttaan2/Downloads/tardis-data/kurucz_cd23_chianti_H_He.h5
INFO:tardis.io.atom_data.util:
        Atom Data kurucz_cd23_chianti_H_He.h5 not found in local path.
        Exists in TARDIS Data repo /home/duttaan2/Downloads/tardis-data/kurucz_cd23_chianti_H_He.h5
INFO:tardis.io.atom_data.base:Reading Atom Data with: UUID = 6f7b09e887a311e7a06b246e96350010 MD5  = 864f1753714343c41f99cb065710cace
INFO:tardis.io.atom_data.base:Non provided Atomic Data: synpp_refs, photoionization_data, yg_data, two_photon_data, linelist_atoms, linelist_molecules
[3]:
config = config_reader.Configuration.from_yaml("../../tardis/io/configuration/tests/data/tardis_configv1_density_exponential_nebular.yml")
config.supernova.time_explosion = 2.0 * u.day
[4]:
workflow = tardis_he_workflow.TARDISHEWorkflow(atom_data, config)
WARNING:tardis.io.model.parse_density_configuration:Number of density points larger than number of shells. Assuming inner point irrelevant
INFO:tardis.model.matter.decay:Decaying abundances for 172800.0 seconds
[5]:
time_start = 2.0
time_end = 5.0
number_of_packets = 100000
time_steps = 10
time_space = 'log'
seed = 1
fp = 0
spectrum_bins = 500
grey_opacity=-1
[6]:
tardis_high_energy = workflow.run(time_start, time_end, number_of_packets,
            time_steps, time_space, seed, fp, spectrum_bins)
INFO:tardis.model.matter.decay:Decaying abundances for 16581.581519365536 seconds
INFO:tardis.model.matter.decay:Decaying abundances for 18172.720672625794 seconds
INFO:tardis.model.matter.decay:Decaying abundances for 19916.542716964905 seconds
INFO:tardis.model.matter.decay:Decaying abundances for 21827.69883181028 seconds
INFO:tardis.model.matter.decay:Decaying abundances for 23922.246097781474 seconds
INFO:tardis.model.matter.decay:Decaying abundances for 26217.782404475234 seconds
INFO:tardis.model.matter.decay:Decaying abundances for 28733.594303762293 seconds
INFO:tardis.model.matter.decay:Decaying abundances for 31490.819050823688 seconds
INFO:tardis.model.matter.decay:Decaying abundances for 34512.6221943585 seconds
INFO:tardis.model.matter.decay:Decaying abundances for 37824.3922080323 seconds
INFO:tardis.energy_input.main_gamma_ray_loop:Total energy in gamma-rays is 1.5213954755851723e+48
INFO:tardis.energy_input.main_gamma_ray_loop:Energy per packet is 1.5213954755851722e+43
INFO:tardis.energy_input.main_gamma_ray_loop:Creating packets
INFO:tardis.energy_input.main_gamma_ray_loop:Creating packet list
INFO:tardis.energy_input.main_gamma_ray_loop:Total energy deposited by the positrons is 3.723993921313078e+45
INFO:tardis.energy_input.main_gamma_ray_loop:Entering the main gamma-ray loop
INFO:tardis.energy_input.main_gamma_ray_loop:Total number of packets is 100000
INFO:tardis.energy_input.main_gamma_ray_loop:Total CMF energy is 1.5213954755864064e+48
INFO:tardis.energy_input.main_gamma_ray_loop:Total RF energy is 1.5224907610143594e+48
/home/duttaan2/Software/tardis/tardis/energy_input/gamma_packet_loop.py:199: NumbaPerformanceWarning: np.dot() is faster on contiguous arrays, called on (Array(float64, 1, 'C', False, aligned=True), Array(float64, 1, 'A', False, aligned=True))
  ) = distance_trace(
/home/duttaan2/Software/tardis/tardis/energy_input/gamma_packet_loop.py:235: NumbaPerformanceWarning: np.dot() is faster on contiguous arrays, called on (Array(float64, 1, 'A', False, aligned=True), Array(float64, 1, 'C', False, aligned=True))
  packet, ejecta_energy_gained = process_packet_path(packet)
/home/duttaan2/miniforge3/envs/tardis/lib/python3.11/site-packages/numba/core/ir_utils.py:2149: NumbaPendingDeprecationWarning: 
Encountered the use of a type that is scheduled for deprecation: type 'reflected list' found for argument 'packets' of function 'gamma_packet_loop'.

For more information visit https://numba.readthedocs.io/en/stable/reference/deprecation.html#deprecation-of-reflection-for-list-and-set-types

File "../../tardis/energy_input/gamma_packet_loop.py", line 33:
@njit(**njit_dict_no_parallel)
def gamma_packet_loop(
^

  warnings.warn(NumbaPendingDeprecationWarning(msg, loc=loc))
INFO:tardis.energy_input.main_gamma_ray_loop:Total energy deposited by gamma-rays and positrons is 1.4441820535281093e+48
Entering gamma ray loop for 100000 packets
Number of escaped packets: 4822
Number of scattered packets: 2242
[7]:
# escaped energy packets
tardis_high_energy.escape_energy
[7]:
172800.000000 189381.581519 207554.302192 227470.844909 249298.543741 273220.789839 299438.572243 328172.166547 359662.985598 394175.607792
100.000000 0.0 7.727029e+21 3.821726e+21 9.750614e+21 2.966022e+21 5.915785e+21 2.683652e+21 0.0 2.242530e+21 3.701607e+21
100.834051 0.0 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 5.371364e+21 0.000000e+00 0.0 0.000000e+00 1.995633e+21
101.675058 0.0 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.0 0.000000e+00 0.000000e+00
102.523080 0.0 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.0 0.000000e+00 0.000000e+00
103.378174 0.0 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.0 0.000000e+00 1.996666e+21
... ... ... ... ... ... ... ... ... ... ...
6103.390288 0.0 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.0 0.000000e+00 0.000000e+00
6154.295664 0.0 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.0 0.000000e+00 0.000000e+00
6205.625616 0.0 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.0 0.000000e+00 0.000000e+00
6257.383686 0.0 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.0 0.000000e+00 0.000000e+00
6309.573445 0.0 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.0 0.000000e+00 0.000000e+00

500 rows × 10 columns

[8]:
# packets information

tardis_high_energy.packets_escaped
[8]:
packet_index status nu_cmf nu_rf energy_cmf energy_rf shell_number
0 0.0 0.0 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.0
1 1.0 3.0 1.483595e+20 1.453161e+20 1.518037e+43 1.486897e+43 9.0
2 0.0 0.0 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.0
3 3.0 3.0 2.130305e+19 2.195378e+19 1.501661e+43 1.547531e+43 3.0
4 4.0 3.0 1.112090e+20 1.073187e+20 1.519772e+43 1.466608e+43 0.0
... ... ... ... ... ... ... ...
99995 99995.0 3.0 1.581968e+20 1.558250e+20 1.520342e+43 1.497547e+43 7.0
99996 0.0 0.0 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.0
99997 99997.0 3.0 3.091819e+20 3.041979e+20 1.520698e+43 1.496185e+43 2.0
99998 0.0 0.0 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.0
99999 0.0 0.0 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.0

100000 rows × 7 columns

[ ]: