tardis.transport.montecarlo.single_packet_loop module

tardis.transport.montecarlo.single_packet_loop.set_packet_props_full_relativity(r_packet: RPacket, time_explosion: float) None[source]

Set packet properties using full relativistic corrections.

This function applies inverse Doppler corrections to the packet frequency, energy, and direction cosine based on full relativistic treatment, including aberration effects on the direction cosine.

Parameters:
r_packetRPacket

The radiative packet whose properties will be modified.

time_explosionfloat

Time since explosion in seconds, used to calculate velocity.

Returns:
None

Modifies r_packet.nu, r_packet.energy, and r_packet.mu in-place.

tardis.transport.montecarlo.single_packet_loop.set_packet_props_partial_relativity(r_packet: RPacket, time_explosion: float) None[source]

Set packet properties using partial relativistic corrections.

This function applies inverse Doppler corrections to the packet frequency and energy based on partial relativistic treatment (first-order in v/c).

Parameters:
r_packetRPacket

The radiative packet whose properties will be modified.

time_explosionfloat

Time since explosion in seconds, used to calculate velocity.

Returns:
None

Modifies r_packet.nu and r_packet.energy in-place.

tardis.transport.montecarlo.single_packet_loop.single_packet_loop(r_packet: RPacket, numba_radial_1d_geometry: NumbaRadial1DGeometry, time_explosion: float, opacity_state: OpacityStateNumba, estimators: RadiationFieldMCEstimators, vpacket_collection: VPacketCollection, rpacket_tracker, montecarlo_configuration: MonteCarloConfiguration) None[source]

Execute Monte Carlo transport for a single radiative packet.

This function performs the complete Monte Carlo transport simulation for a single r-packet, handling all interactions including line scattering, electron scattering, and continuum processes. The packet is traced through the ejecta until it escapes or is absorbed.

Parameters:
r_packetRPacket

The radiative packet to transport through the ejecta.

numba_radial_1d_geometryNumbaRadial1DGeometry

The spherically symmetric geometry of the supernova ejecta.

time_explosionfloat

Time since explosion in seconds.

opacity_stateOpacityStateNumba

Current opacity state containing line and continuum opacities.

estimatorsRadiationFieldMCEstimators

Monte Carlo estimators for radiation field quantities.

vpacket_collectionVPacketCollection

Collection for storing virtual packets when enabled.

rpacket_trackerRPacketTracker or RPacketLastInteractionTracker

Tracker for recording packet interactions and trajectories.

montecarlo_configurationMonteCarloConfiguration

Configuration parameters for the Monte Carlo simulation.

Returns:
None

This function modifies the r_packet object in-place and updates estimators and collections. No return value.