tardis.transport.montecarlo.modes.nonhomologous.tau_sobolev module

class tardis.transport.montecarlo.modes.nonhomologous.tau_sobolev.BetaSobolev(plasma_parent)[source]

Bases: ProcessingPlasmaProperty

Calculate Sobolev escape probabilities as a plasma property.

Attributes:
beta_sobolevNumpy Array, dtype float
calculate(tau_sobolevs)[source]

Calculate Sobolev escape probabilities.

latex_name = ('\\beta_{\\textrm{sobolev}}',)
outputs = ('beta_sobolev',)
class tardis.transport.montecarlo.modes.nonhomologous.tau_sobolev.TauSobolev(plasma_parent)[source]

Bases: ProcessingPlasmaProperty

Calculate Sobolev optical depths as a plasma property.

Attributes:
tau_sobolevPandas DataFrame, dtype float

Sobolev optical depth for each line. Indexed by line. Columns as zones.

calculate(lines, level_number_density, velocity_gradient, stimulated_emission_factor)[source]

Calculate Sobolev line opacity.

Calculates the Sobolev line opacity based on the provided parameters.

Parameters:
linespandas.DataFrame

DataFrame containing information about spectral lines.

level_number_densitypandas.DataFrame

DataFrame with level number densities.

velocity_gradientnp.ndarray

Local dv/dr per cell.

stimulated_emission_factorfloat

Factor for stimulated emission.

Returns:
pandas.DataFrame

Calculated Sobolev line opacity values.

Raises:
ValueError

If any calculated tau_sobolevs are nan or inf.

latex_formula = ('\\dfrac{\\pi e^{2}}{m_{e} c}f_{lu}\\lambda t_{exp}\\\n        n_{lower} \\Big(1-\\dfrac{g_{lower}n_{upper}}{g_{upper}n_{lower}}\\Big)',)
latex_name = ('\\tau_{\\textrm{sobolev}}',)
outputs = ('tau_sobolevs',)
tardis.transport.montecarlo.modes.nonhomologous.tau_sobolev.calculate_beta_sobolev(tau_sobolevs)[source]

Calculate the beta Sobolev values based on the provided tau_sobolevs.

Values from the previous iteration can be provided.

Parameters:
tau_sobolevspd.DataFrame

Tau Sobolev opacities.

Returns:
pd.DataFrame

The latest Beta Sobolev opacities.

tardis.transport.montecarlo.modes.nonhomologous.tau_sobolev.calculate_beta_sobolev_directional(sobolev_optical_depth_coefficient: DataFrame, velocity_gradient: Quantity, velocity_over_radius: Quantity, quadrature_order: int = 20) → DataFrame[source]

Calculate the angle-averaged Sobolev escape probability.

The directional beta_sobolev averages (1.0 - np.exp(-tau)) / tau over quadrature_order number of direction cosines, where tau is sobolev_optical_depth_coefficient / abs(projected_velocity_gradient). The angular interval is split where the projected gradient changes sign.

Parameters:
sobolev_optical_depth_coefficientpandas.DataFrame

Velocity-gradient-independent Sobolev optical-depth coefficient [s^-1].

velocity_gradientastropy.units.Quantity

Radial velocity derivative in each shell [s^-1].

velocity_over_radiusastropy.units.Quantity

Ratio of radial velocity to radius in each shell [s^-1].

quadrature_orderint, optional

Gauss-Legendre order used on each smooth angular interval.

Returns:
pandas.DataFrame

Angle-averaged Sobolev escape probabilities for each line and shell.

tardis.transport.montecarlo.modes.nonhomologous.tau_sobolev.calculate_sobolev_line_opacity(lines, level_number_density, velocity_gradient, stimulated_emission_factor)[source]

Calculate the Sobolev line opacity from populations and velocity gradient.

Parameters:
linespandas.DataFrame

DataFrame containing information about spectral lines.

level_number_densitypandas.DataFrame

DataFrame with level number densities.

velocity_gradientnp.ndarray

Local dv/dr per cell.

stimulated_emission_factorfloat

Factor for stimulated emission.

Returns:
pandas.DataFrame

Calculated Sobolev line opacity values.

Raises:
ValueError

If any calculated tau_sobolevs are nan or inf.

Examples

>>> calculate_sobolev_line_opacity(lines_data, level_density_data, time_exp, stim_factor)
tardis.transport.montecarlo.modes.nonhomologous.tau_sobolev.calculate_sobolev_optical_depth_coefficient(lines: DataFrame, level_number_density: DataFrame, stimulated_emission_factor: DataFrame) → DataFrame[source]

Calculate the velocity-gradient-independent Sobolev optical-depth coefficient.

Parameters:
linespandas.DataFrame

Atomic line data containing wavelength and oscillator strength.

level_number_densitypandas.DataFrame

Lower-level number densities for each shell [cm^-3].

stimulated_emission_factorpandas.DataFrame

Stimulated-emission correction for each line and shell.

Returns:
pandas.DataFrame

Coefficient for each line and shell [s^-1]. Dividing by the absolute projected velocity gradient gives the directional Sobolev optical depth.

tardis.transport.montecarlo.modes.nonhomologous.tau_sobolev.numba_calculate_beta_sobolev(tau_sobolevs, beta_sobolevs)[source]

Calculate Sobolev escape probabilities in place.