tardis.transport.montecarlo.interaction module

tardis.transport.montecarlo.interaction.adiabatic_cooling(r_packet)[source]

Adiabatic cooling - equivalent to destruction of the packet

Parameters:
r_packet: tardis.transport.montecarlo.r_packet.RPacket
tardis.transport.montecarlo.interaction.bf_cooling(r_packet, time_explosion, opacity_state, enable_full_relativity)[source]

Bound-Free Cooling - Determine and run bf emission from cooling

Parameters:
r_packettardis.transport.montecarlo.r_packet.RPacket
time_explosionfloat
opacity_statetardis.transport.montecarlo.numba_interface.OpacityState
tardis.transport.montecarlo.interaction.bound_free_emission(r_packet, time_explosion, opacity_state, continuum_id, enable_full_relativity)[source]

Bound-Free emission - set the frequency from photo-ionization

Parameters:
r_packettardis.transport.montecarlo.r_packet.RPacket
time_explosionfloat
opacity_statetardis.transport.montecarlo.numba_interface.OpacityState
continuum_idint
tardis.transport.montecarlo.interaction.continuum_event(r_packet, time_explosion, opacity_state, chi_bf_tot, chi_ff, chi_bf_contributions, current_continua, enable_full_relativity)[source]

continuum event handler - activate the macroatom and run the handler

Parameters:
r_packettardis.transport.montecarlo.r_packet.RPacket
time_explosionfloat
opacity_statetardis.transport.montecarlo.numba_interface.OpacityState
continuumtardis.transport.montecarlo.numba_interface.Continuum
tardis.transport.montecarlo.interaction.determine_bf_macro_activation_idx(opacity_state, nu, chi_bf_contributions, active_continua)[source]

Determine the macro atom activation level after bound-free absorption.

Parameters:
nufloat

Comoving frequency of the r-packet.

chi_bf_contributionsnumpy.ndarray, dtype float

Cumulative distribution of bound-free opacities at frequency nu.

active_continuanumpy.ndarray, dtype int

Continuum ids for which absorption is possible for frequency nu.

Returns:
float

Macro atom activation idx.

tardis.transport.montecarlo.interaction.determine_continuum_macro_activation_idx(opacity_state, nu, chi_bf, chi_ff, chi_bf_contributions, active_continua)[source]

Determine the macro atom activation level after a continuum absorption.

Parameters:
nufloat

Comoving frequency of the r-packet.

chi_bfnumpy.ndarray, dtype float

Bound-free opacity.

chi_bfnumpy.ndarray, dtype float

Free-free opacity.

chi_bf_contributionsnumpy.ndarray, dtype float

Cumulative distribution of bound-free opacities at frequency nu.

active_continuanumpy.ndarray, dtype int

Continuum ids for which absorption is possible for frequency nu.

Returns:
float

Macro atom activation idx.

tardis.transport.montecarlo.interaction.free_free_emission(r_packet, time_explosion, opacity_state, enable_full_relativity)[source]

Free-Free emission - set the frequency from electron-ion interaction

Parameters:
r_packettardis.transport.montecarlo.r_packet.RPacket
time_explosionfloat
opacity_statetardis.transport.montecarlo.numba_interface.OpacityState
tardis.transport.montecarlo.interaction.get_current_line_id(nu, line_list)[source]

Get the line id corresponding to a frequency nu in a line list

Parameters:
nufloat
line_listnp.ndarray
tardis.transport.montecarlo.interaction.line_emission(r_packet, emission_line_id, time_explosion, opacity_state, enable_full_relativity)[source]

Sets the frequency of the RPacket properly given the emission channel

Parameters:
r_packettardis.transport.montecarlo.r_packet.RPacket
emission_line_idint
time_explosionfloat
opacity_statetardis.transport.montecarlo.numba_interface.OpacityState
tardis.transport.montecarlo.interaction.line_scatter(r_packet, time_explosion, line_interaction_type, opacity_state, enable_full_relativity)[source]

Line scatter function that handles the scattering itself, including new angle drawn, and calculating nu out using macro atom

Parameters:
r_packettardis.transport.montecarlo.r_packet.RPacket
time_explosionfloat
line_interaction_typeenum
opacity_statetardis.transport.montecarlo.numba_interface.OpacityState
tardis.transport.montecarlo.interaction.macro_atom_event(destination_level_idx, r_packet, time_explosion, opacity_state, enable_full_relativity)[source]

Macroatom event handler - run the macroatom and handle the result

Parameters:
destination_level_idxint
r_packettardis.transport.montecarlo.r_packet.RPacket
time_explosionfloat
opacity_statetardis.transport.montecarlo.numba_interface.OpacityState
tardis.transport.montecarlo.interaction.sample_nu_free_bound(opacity_state, shell, continuum_id)[source]
Attributes:
nu_fb_samplerfloat

Frequency of the free-bounds emission process

tardis.transport.montecarlo.interaction.sample_nu_free_free(opacity_state, shell)[source]
Attributes:
nu_ff_samplerfloat

Frequency of the free-free emission process

tardis.transport.montecarlo.interaction.thomson_scatter(r_packet, time_explosion, enable_full_relativity)[source]

Thomson scattering — no longer line scattering

  1. get the doppler factor at that position with the old angle

  2. convert the current energy and nu into the comoving frame with the old mu

  3. Scatter and draw new mu - update mu

  4. Transform the comoving energy and nu back using the new mu

Parameters:
r_packettardis.transport.montecarlo.r_packet.RPacket
time_explosionfloat

time since explosion in seconds