tardis.transport.montecarlo.interaction_events module¶
- class tardis.transport.montecarlo.interaction_events.LineInteractionType(*values)[source]¶
Bases:
IntEnum- DOWNBRANCH = 1¶
- MACROATOM = 2¶
- SCATTER = 0¶
- tardis.transport.montecarlo.interaction_events.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_events.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_events.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_events.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_events.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_events.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_events.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_events.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_events.sample_nu_free_free(opacity_state, shell)[source]¶
- Attributes:
- nu_ff_samplerfloat
Frequency of the free-free emission process
- tardis.transport.montecarlo.interaction_events.thomson_scatter(r_packet, time_explosion, enable_full_relativity)[source]¶
Thomson scattering — no longer line scattering
get the doppler factor at that position with the old angle
convert the current energy and nu into the comoving frame with the old mu
Scatter and draw new mu - update mu
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