tardis.workflows.simple_simulation module

class tardis.workflows.simple_simulation.SimpleSimulation(configuration)[source]

Bases: WorkflowLogging

check_convergence(estimated_values)[source]

Check convergence status for a dict of estimated values

Parameters:
estimated_valuesdict

Estimates to check convergence

Returns:
bool

If convergence has occurred

enable_virtual_packet_logging = False
get_convergence_estimates(transport_state)[source]

Compute convergence estimates from the transport state

Parameters:
transport_stateMonteCarloTransportState

Transport state object to compute estimates

Returns:
dict

Convergence estimates

EstimatedRadiationFieldProperties

Dilute radiation file and j_blues dataclass

initialize_spectrum_solver(transport_state, virtual_packet_energies=None)[source]

Set up the spectrum solver

Parameters:
transport_stateMonteCarloTransportState

The transport state to init with

virtual_packet_energiesndarray, optional

Array of virtual packet energies binned by frequency, by default None

log_level = None
run()[source]

Run the TARDIS simulation until convergence is reached

show_progress_bars = False
solve_montecarlo(opacity, no_of_real_packets, no_of_virtual_packets=0)[source]

Solve the MonteCarlo process

Parameters:
no_of_real_packetsint

Number of real packets to simulate

no_of_virtual_packetsint, optional

Number of virtual packets to simulate per interaction, by default 0

Returns:
MonteCarloTransportState

The new transport state after simulation

ndarray

Array of unnormalized virtual packet energies in each frequency bin

solve_opacity()[source]

Solves the opacity state and any associated objects

Returns:
dict
opacity_statetardis.opacities.opacity_state.OpacityState

State of the line opacities

macro_atom_statetardis.opacities.macro_atom.macro_atom_state.MacroAtomState or None

State of the macro atom

solve_plasma(estimated_radfield_properties)[source]

Update the plasma solution with the new radiation field estimates

Parameters:
estimated_radfield_propertiesEstimatedRadiationFieldProperties

The radiation field properties to use for updating the plasma

Raises:
ValueError

If the plasma solver radiative rates type is unknown

solve_simulation_state(estimated_values)[source]

Update the simulation state with new inputs computed from previous iteration estimates.

Parameters:
estimated_valuesdict

Estimated from the previous iterations

Returns:
next_valuesdict

The next values assigned to the simulation state

specific_log_level = None