tardis.spectrum.formal_integral.source_function module¶
- class tardis.spectrum.formal_integral.source_function.SourceFunctionSolver(line_interaction_type: str)[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: float, time_of_simulation: Quantity, volume: Quantity, j_blue_estimator: ndarray) ndarray [source]¶
Calculates Jblue_lu, the normalized J estimator from the blue end of the line from lower to upper level
- Parameters:
- time_explosionfloat
Time duration of the explosion in seconds
- time_of_simulationastropy.units.Quantity
Time duration of the simulation
- volumeastropy.units.Quantity
- j_blue_estimatornp.ndarray
the line estimator
- Returns:
- np.ndarray
The normalized J estimator from the blue end of the line from lower to upper level
- calculate_Jred_lu(Jblue_lu: ndarray, tau_sobolevs: ndarray, att_S_ul: ndarray) ndarray [source]¶
Calculates Jred_lu, J estimator from the red end of the line from lower to upper level
- Parameters:
- Jblue_lunp.ndarray
the normalized J estimator from the blue end of the line from lower to upper level
- tau_sobolevsnp.ndarray
Sobolev optical depths
- att_S_ulnp.ndarray
The attenuated source function
- Returns:
- np.ndarray
J estimator from the red end of the line from lower to upper level
- calculate_att_S_ul(lines: DataFrame, transition_probabilities: ndarray, no_of_shells: int, transition_line_id: ndarray, line_idx: ndarray, transitions_index: Index, transition_type: ndarray, e_dot_u: DataFrame, time_explosion: float) ndarray [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:
- linespd.DataFrame
atomic line data
- transition_probabilitiesnp.ndarray
- no_of_shellsint
Number of shells in the simulation
- transition_line_idnp.ndarray
Line ids for the transitions
- line_idxnp.ndarray
Indices of the lines in the atomic data
- transitions_indexpd.Index
Index of the transitions in the macro atom data
- transition_typenp.ndarray
transition types, see https://tardis-sn.github.io/tardis/physics/setup/plasma/macroatom.html#macroatom for flag definitions
- e_dot_upd.DataFrame
the rate energy density is add to the upper level of transitions excited to it
- time_explosionfloat
geometrical explosion time
- Returns:
- np.ndarray
The attenuated source function
- calculate_e_dot_u(time_of_simulation: Quantity, volume: Quantity, tau_sobolevs: ndarray, e_dot_lu_estimator: ndarray, transition_probabilities: ndarray, upper_level_idx: Index, no_of_shells: int, no_lvls: int, line_interaction_type: str, macro_data: DataFrame, macro_ref: DataFrame) DataFrame [source]¶
Calculate e_dot_u, the rate energy density is added to the upper level of transitions excited to it
- Parameters:
- time_of_simulationastropy.units.Quantity
Time duration of the simulation
- volumeastropy.units.Quantity
- tau_sobolevsnp.ndarray
Sobolev optical depths
- e_dot_lu_estimatornp.ndarray
The line estimator for the rate of energy absorption of a transition from lower to upper level
- transition_probabilitiesnp.ndarray
- upper_level_idxpd.Index
Index of the upper levels in the atomic data
- no_of_shellsint
Number of shells in the simulation
- no_lvlsint
Number of levels in the atomic data
- line_interaction_typestr
Type of line interaction (e.g. “macroatom”, “downbranch”)
- macro_datapd.DataFrame
DataFrame containing macro atom data
- macro_refpd.DataFrame
DataFrame containing macro atom references, see http://tardis.readthedocs.io/en/latest/physics/plasma/macroatom.html
- Returns:
- pd.DataFrame
The rate energy density is added to the upper level of transitions excited to it
- solve(sim_state, opacity_state, transport_state, atomic_data) SourceFunctionState [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: ndarray, Jred_lu: ndarray, Jblue_lu: ndarray, e_dot_u: DataFrame)[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
- e_dot_u: DataFrame¶