tardis.spectrum.formal_integral.base module¶
- exception tardis.spectrum.formal_integral.base.BoundsError[source]¶
Bases:
IndexError
- tardis.spectrum.formal_integral.base.calculate_p_values(R_max, N)[source]¶
Calculates the p values of N
- Parameters:
- R_maxfloat64
- Nint64
- Returns:
- float64
- tardis.spectrum.formal_integral.base.check(simulation_state, plasma, transport, raises=True)[source]¶
A method that determines if the formal integral can be performed with the current configuration settings
The function returns False if the configuration conflicts with the required settings. If raises evaluates to True, then a IntegrationError is raised instead
- tardis.spectrum.formal_integral.base.intensity_black_body(nu, temperature)[source]¶
Calculate the blackbody intensity.
- Parameters:
- nufloat64
frequency
- temperaturefloat64
Temperature
- Returns:
- float64
- tardis.spectrum.formal_integral.base.interpolate_integrator_quantities(att_S_ul, Jredlu, Jbluelu, e_dot_u, interpolate_shells, transport, simulation_state, opacity_state, plasma)[source]¶
Interpolate the integrator quantities to interpolate_shells.
- Parameters:
- att_S_ulnp.ndarray
attenuated source function for each line in each shell
- Jredlunp.ndarray
J estimator from the red end of the line from lower to upper level
- Jbluelunp.ndarray
J estimator from the blue end of the line from lower to upper level
- e_dot_unp.ndarray
Line estimator for the rate of energy density absorption from lower to upper level
- interpolate_shellsint
number of shells to interpolate to
- transporttardis.transport.montecarlo.MonteCarloTransportSolver
- simulation_statetardis.model.SimulationState
- opacity_stateOpacityStateNumba
- plasmatardis.plasma.BasePlasma
- Returns:
- tuple
Interpolated values of att_S_ul, Jredlu, Jbluelu, and e_dot_u
- tardis.spectrum.formal_integral.base.make_source_function(simulation_state, opacity_state, transport, plasma, interpolate_shells=0)[source]¶
Calculates the source function using the line absorption rate estimator
Edotlu_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 ———- simulation_state : tardis.model.SimulationState opacity_state : tardis.opacity.OpacityStateNumba transport : tardis.transport.montecarlo.MonteCarloTransportSolver plasma : tardis.plasma.BasePlasma interpolate_shells : int
Number of shells to interpolate to. If set to 0, no interpolation is performed.
- Returns:
- Numpy array containing ( 1 - exp(-tau_ul) ) S_ul ordered by wavelength of the transition u -> l