tardis.transport.montecarlo.packet_source.black_body_relativistic module

class tardis.transport.montecarlo.packet_source.black_body_relativistic.BlackBodySimpleSourceRelativistic(*args: Any, **kwargs: Any)[source]

Bases: BlackBodySimpleSource, HDFWriterMixin

Relativistic blackbody packet source for Monte Carlo simulations.

This class generates blackbody packets with relativistic corrections for sources that are moving with respect to the lab frame. It accounts for the motion of the inner boundary where packets are created.

Parameters:
time_explosionastropy.units.Quantity

Time elapsed since explosion.

radiusastropy.units.Quantity

Initial packet radius.

temperatureastropy.units.Quantity

Absolute temperature.

base_seedint, optional

Base seed for random number generator.

legacy_secondary_seedint, optional

Secondary seed for global numpy rng (Deprecated: Legacy reasons only).

Attributes:
time_explosionastropy.units.Quantity

Time elapsed since explosion.

betafloat

Velocity of the inner boundary as a fraction of speed of light.

Initialize BlackBodySimpleSourceRelativistic.

Parameters:
time_explosionastropy.units.Quantity, optional

Time elapsed since explosion. Default is None.

**kwargsAny

Additional keyword arguments passed to parent class.

create_packet_energies(no_of_packets: int) Quantity[source]

Create relativistic packet energies with uniform distribution.

Uniformly distribute energy in arbitrary units where the ensemble of packets has total energy corrected for relativistic effects. Applies corrections for the static inner boundary to comoving frame transformation and time dilation.

Parameters:
no_of_packetsint

Number of packets to create.

Returns:
astropy.units.Quantity

Array of packet energies in erg with relativistic corrections.

create_packet_mus(no_of_packets: int) ndarray[source]

Create relativistic packet direction cosines.

Direction cosines are distributed according to the relativistic transformation \(\mu^\prime=2 \frac{\mu^\prime + \beta}{2 \beta + 1}\). The distribution accounts for the fact that the inner boundary on which the packets are initialized is not comoving with the material.

Parameters:
no_of_packetsint

Number of packets to create.

Returns:
numpy.ndarray

Array of relativistically corrected direction cosines for packets.

create_packets(no_of_packets: int, *args: Any, **kwargs: Any) PacketCollection[source]

Generate relativistic black-body packet properties as arrays.

Calculates the velocity (beta) of the inner boundary and applies relativistic corrections to packet creation.

Parameters:
no_of_packetsint

Number of packets to create.

*argsAny

Additional positional arguments.

**kwargsAny

Additional keyword arguments.

Returns:
PacketCollection

Collection of packets with relativistic corrections applied.

Raises:
ValueError

If radius or time_explosion is not set.

classmethod from_simulation_state(simulation_state, *args: Any, **kwargs: Any) BlackBodySimpleSourceRelativistic[source]

Create BlackBodySimpleSourceRelativistic from simulation state.

Parameters:
simulation_stateSimulationState

The simulation state object containing explosion time, inner radius, and temperature.

*argsAny

Additional positional arguments.

**kwargsAny

Additional keyword arguments.

Returns:
BlackBodySimpleSourceRelativistic

New instance initialized with simulation state parameters.

hdf_properties = ['time_explosion', 'radius', 'temperature', 'base_seed']