tardis.spectrum.formal_integral.source_function module

class tardis.spectrum.formal_integral.source_function.SourceFunctionSolver(line_interaction_type)[source]

Bases: object

Configures the source function solver

Parameters:
line_interaction_typestr

The type of line interaction (e.g. “downbranch”, “macroatom”).

calculate_Jblue_lu(time_explosion, time_of_simulation, volume, j_blue_estimator)[source]

Calculates Jblue_lu, the normalized J estimator from the blue end of the line from lower to upper level

Parameters:
time_explosion: float

Time duration of the explosion in seconds

time_of_simulation: float

Time duration of the simulation

volume: astropy.units.Quantity
j_blue_estimator: np.ndarray

the line estimator

calculate_Jred_lu(Jblue_lu, tau_sobolevs, att_S_ul)[source]

Calculates Jred_lu, J estimator from the red end of the line from lower to upper level

calculate_att_S_ul(lines, transition_probabilities, no_of_shells, transition_line_id, line_idx, transitions_index, transition_type, e_dot_u, time_explosion)[source]

Calculates the source function using the line absorption rate estimator e_dot_lu_estimator

Formally it calculates the expression ( 1 - exp(-tau_ul) ) S_ul but this product is what we need later, so there is no need to factor out the source function explicitly.

Parameters:
lines: pd.DataFrame

atomic line data

transition_probabilities: np.ndarray
no_of_shells: int

Number of shells in the simulation

transition_line_id: np.ndarray

Line ids for the transitions

line_idx: np.ndarray

Indices of the lines in the atomic data

transitions_index: pd.Index

Index of the transitions in the macro atom data

transition_type: np.ndarray

transition types, see https://tardis-sn.github.io/tardis/physics/setup/plasma/macroatom.html#macroatom for flag definitions

e_dot_u: pd.DataFrame

the rate energy density is add to the upper level of transitions excited to it

time_explosion: float

geometrical explosion time

calculate_e_dot_u(time_of_simulation, volume, tau_sobolevs, e_dot_lu_estimator, transition_probabilities, upper_level_idx, no_of_shells, no_lvls, line_interaction_type, macro_data, macro_ref)[source]

Calculate e_dot_u, the rate energy density is added to the upper level of transitions excited to it

Parameters:
time_of_simulation: float

Time duration of the simulation

volume: astropy.units.Quantity
tau_sobolevs: np.ndarray

Sobolev optical depths

e_dot_lu_estimator: np.ndarray

The line estimator for the rate of energy absorption of a transition from lower to upper level

transition_probabilities: np.ndarray
upper_level_idx: pd.Index

Index of the upper levels in the atomic data

no_of_shells: int

Number of shells in the simulation

no_lvls: int

Number of levels in the atomic data

line_interaction_type: str

Type of line interaction (e.g. “macroatom”, “downbranch”)

macro_data: pd.DataFrame

DataFrame containing macro atom data

macro_ref: pd.DataFrame

DataFrame containing macro atom references, see http://tardis.readthedocs.io/en/latest/physics/plasma/macroatom.html

solve(sim_state, opacity_state, transport_state, atomic_data)[source]

Solves for att_S_ul, Jred_lu, Jblue_lu, and e_dot_u.

Parameters:
sim_statetardis.model.SimulationState
opacity_statetardis.transport.montecarlo.OpacityState
transport_statetardis.transport.montecarlo.TransportState
atomic_datatardis.atomic.AtomicData

The atomic data for the simulation.

Returns:
SourceFunctionState with attributes
att_S_ulnp.ndarray

The attenuated source function

Jred_lunp.ndarray

the normalized J estimator from the red end of the line from lower to upper level

Jblue_lunp.ndarray

the normalized J estimator from the blue end of the line from lower to upper level

e_dot_upd.DataFrame

The rate energy density is added to the upper level of transitions excited to it

class tardis.spectrum.formal_integral.source_function.SourceFunctionState(att_S_ul, Jred_lu, Jblue_lu, e_dot_u)[source]

Bases: object

Data class to hold the computed source function values

Attributes:

att_S_ulnp.ndarray

The attenuated source function

Jred_lunp.ndarray

the normalized J estimator from the red end of the line from lower to upper level

Jblue_lunp.ndarray

the normalized J estimator from the blue end of the line from lower to upper level

e_dot_upd.DataFrame

The rate energy density is added to the upper level of transitions excited to it

Jblue_lu: ndarray
Jred_lu: ndarray
att_S_ul: ndarray
e_dot_u: DataFrame