tardis.opacities.opacities module¶
- tardis.opacities.opacities.calculate_tau_electron(electron_density, distance)[source]¶
Calculate tau for Thomson scattering
- Parameters:
- electron_densityfloat
- distancefloat
- Returns:
- tau_electronfloat
tau for thomson scattering
- tardis.opacities.opacities.chi_bf_interpolator(opacity_state, nu, shell)[source]¶
Interpolate the bound-free opacity.
This function interpolates the tabulated bound-free opacities and cross-sections to new frequency values
nu
.- Parameters:
- opacity_stateOpacityState
- nufloat, dtype float
Comoving frequency of the r-packet.
- shellint, dtype float
Current computational shell.
- Returns:
- chi_bf_totfloat
Total bound-free opacity at frequency
nu
.- chi_bf_contributionsnumpy.ndarray, dtype float
Cumulative distribution function of the contributions of the individual bound free continua to the total bound-free opacity.
- current_continuanumpy.ndarray, dtype int
Continuum ids for which absorption is possible for frequency
nu
.- x_sect_bfsnumpy.ndarray, dtype float
Photoionization cross-sections of all bound-free continua for which absorption is possible for frequency
nu
.
- tardis.opacities.opacities.chi_continuum_calculator(opacity_state, nu, shell)[source]¶
- Returns:
- chi_bf_totfloat
Total bound-free opacity at frequency
nu
.- chi_bf_contributionsnumpy.ndarray, dtype float
Cumulative distribution function of the contributions of the individual bound free continua to the total bound-free opacity.
- current_continuanumpy.ndarray, dtype int
Continuum ids for which absorption is possible for frequency
nu
.- x_sect_bfsnumpy.ndarray, dtype float
Photoionization cross-sections of all bound-free continua for which absorption is possible for frequency
nu
.- chi_fffloat64
Free Free opacity at frequency
nu
- Attributes:
- opacity_stateOpacityState
- nufloat64
Comoving frequency of the r_packet
- shellint64
Current shell id of the r_packet
- tardis.opacities.opacities.chi_electron_calculator(opacity_state, nu, shell)[source]¶
Calculate chi for Thomson scattering
- Parameters:
- opacity_stateOpacityState
- nufloat
Comoving frequency of the r-packet.
- shellint
Shell of current r_packet
- Returns:
- numpy.ndarray, dtype int
Continuum ids for which absorption is possible for frequency
nu
.
- tardis.opacities.opacities.chi_ff_calculator(opacity_state, nu, shell)[source]¶
- Returns:
- chi_fffloat64
Free Free opacity
- Attributes:
- opacity_stateOpacityState
- nufloat64
Comoving frequency of the r_packet
- shellint64
Current shell id of the r_packet
- tardis.opacities.opacities.compton_opacity_calculation(energy, electron_density)[source]¶
Calculate the Compton scattering opacity for a given energy (Rybicki & Lightman, 1979)
$ rho / 2 p_m times 3/4 sigma_T ((1 + kappa) / kappa^3 ((2kappa(1 + kappa)) / (1 + 2kappa) - ln(1 + 2kappa) + 1/(2kappa) ln(1 + 2kappa) - (1 + 3kappa) / (1 + 2kappa)^2) $
- Parameters:
- energyfloat
The energy of the photon
- ejecta_densityfloat
The density of the ejecta
- Returns:
- float
The Compton scattering opacity
- tardis.opacities.opacities.compton_opacity_partial(energy, fraction)[source]¶
Partial Compton scattering opacity, from artis file gamma.cc
- Parameters:
- energyfloat
packet energy in terms of electron rest energy
- fractionfloat
1 + 2 * packet energy
- Returns:
- np.float64
Compton scattering opacity
- tardis.opacities.opacities.get_current_bound_free_continua(opacity_state, nu)[source]¶
Determine bound-free continua for which absorption is possible.
- Parameters:
- opacity_stateOpacityState
- nufloat
Comoving frequency of the r-packet.
- Returns:
- numpy.ndarray, dtype int
Continuum ids for which absorption is possible for frequency
nu
.
- tardis.opacities.opacities.kappa_calculation(energy)[source]¶
Calculates kappa for various other calculations i.e. energy normalized to electron rest energy 511.0 KeV
- Parameters:
- energyfloat
- Returns:
- kappafloat
- tardis.opacities.opacities.pair_creation_opacity_artis(energy, ejecta_density, iron_group_fraction)[source]¶
Calculates pair creation opacity for a given energy Approximate treatment from Ambwani & Sutherland (1988) as implemented in ARTIS
- Parameters:
- energyfloat
Photon energy
- ejecta_densityfloat
The density of the ejecta
- iron_group_fractionfloat
Fraction of iron group elements in the shell
- Returns:
- float
Pair creation opacity
- tardis.opacities.opacities.pair_creation_opacity_calculation(energy, ejecta_density, iron_group_fraction)[source]¶
Calculates pair creation opacity for a given energy Approximate treatment from Ambwani & Sutherland (1988)
- Parameters:
- energyfloat
Photon energy
- ejecta_densityfloat
The density of the ejecta
- iron_group_fractionfloat
Fraction of iron group elements in the shell
- Returns:
- float
Pair creation opacity
- tardis.opacities.opacities.photoabsorption_opacity_calculation(energy, ejecta_density, iron_group_fraction)[source]¶
Calculates photoabsorption opacity for a given energy Approximate treatment from Ambwani & Sutherland (1988) Magic numbers are from the approximate treatment
- Parameters:
- energyfloat
Photon energy
- ejecta_densityfloat
The density of the ejecta
- iron_group_fractionfloat
Fraction of iron group elements in the shell
- Returns:
- float
Photoabsorption opacity
- tardis.opacities.opacities.photoabsorption_opacity_calculation_kasen(energy, number_density, proton_count)[source]¶
Calculates photoabsorption opacity for a given energy Approximate treatment from Kasen et al. (2006)
- Parameters:
- energyfloat
Photon energy
- number_densityfloat
The number density of the ejecta for each atom
- proton_countfloat
Number of protons for each atom in the ejecta
- Returns:
- float
Photoabsorption opacity