tardis.energy_input.main_gamma_ray_loop module

tardis.energy_input.main_gamma_ray_loop.calculate_electron_number_density(simulation_state: SimulationState, ejecta_volume: ndarray, effective_time_array: ndarray, legacy: bool = False, legacy_atom_data: object | None = None) ndarray[source]

Calculate electron number density and its time evolution.

Parameters:
modelSimulationState

Tardis model object.

ejecta_volumenp.ndarray

Ejecta volume array.

effective_time_arraynp.ndarray

Effective time array in seconds.

legacybool, optional

Whether to use legacy calculation method. Default is False.

legacy_atom_dataobject, optional

Legacy atom data object. Required if legacy=True.

Returns:
electron_number_density_timenp.ndarray

Electron number density evolution with time.

tardis.energy_input.main_gamma_ray_loop.get_effective_time_array(time_start, time_end, time_space, time_steps)[source]

Function to get the effective time array for the gamma-ray loop.

Parameters:
time_startfloat

start time in days.

time_endfloat

end time in days.

time_spacestr

linear or log.

time_stepsint

number of time steps.

Returns:
timesnp.ndarray

array of times in secs.

effective_time_arraynp.ndarray

effective time array in secs.

tardis.energy_input.main_gamma_ray_loop.get_packet_properties(number_of_shells, times, time_steps, packets)[source]

Function to get the properties of the packets.

Parameters:
packetslist

List of packets.

Returns:
packets_nu_cmf_arraynp.ndarray

Array of packets in cmf.

packets_nu_rf_arraynp.ndarray

Array of packets in rf.

packets_energy_cmf_arraynp.ndarray

Array of packets energy in cmf.

packets_energy_rf_arraynp.ndarray

Array of packets energy in rf.

packets_positron_energy_arraynp.ndarray

Array of packets positron energy.

tardis.energy_input.main_gamma_ray_loop.run_gamma_ray_loop(simulation_state, legacy_isotope_decacy_df, cumulative_decays_df, number_of_packets, times, effective_time_array, seed, positronium_fraction, spectrum_bins, grey_opacity, photoabsorption_opacity='tardis', pair_creation_opacity='tardis', legacy=False, legacy_atom_data=None)[source]

Main loop to determine the gamma-ray propagation through the ejecta.

Parameters:
modeltardis.model.Radial1DModel

Tardis model object.

plasmatardis.plasma.standard_plasmas.BasePlasma

Tardis plasma object.

isotope_decay_dfpd.DataFrame

DataFrame containing the cumulative decay data.

cumulative_decays_dfpd.DataFrame

DataFrame containing the time evolving mass fractions.

num_decaysint

Number of packets to decay.

timesnp.ndarray

Array of times in days.

effective_time_arraynp.ndarray

Effective time array in days.

seedint

Seed for the random number generator.

positronium_fractionfloat

Fraction of positronium.

spectrum_binsint

Number of spectrum bins.

grey_opacityfloat

Grey opacity.

photoabsorption_opacitystr

Photoabsorption opacity.

pair_creation_opacitystr

Pair creation opacity.

Returns:
escape_energypd.DataFrame

DataFrame containing the energy escaping the ejecta.

packets_df_escapedpd.DataFrame

DataFrame containing the packets info that escaped the ejecta.