Skip to content
Projects

opencr.analysis.emission

Line emission and synthetic spectra.

Each spontaneous emission u -> l of a network is a line of photon energy E_u - E_l with emissivity eps = n_u A_ul (photons m^-3 s^-1; the escape factor is already in A). In a quasi-static solve the upper population is a sum over the drivers, n_u = sum_d C_ud n_d, so the emissivity splits into photon emissivity coefficients PEC_d = A_ul C_ud / n_e (m^3/s) with eps = n_e sum_d PEC_d n_d.

A synthetic spectrum puts each line on a wavelength grid as a Gaussian of the Doppler width at the gas temperature (or a given instrumental FWHM, or both added in quadrature).

Functions

NameDescription
doppler_fwhmReturn the Doppler FWHM in nm of lines at wavelength (nm), kT in eV, mass in kg.
hydrogen_line_nameReturn the spectroscopic name of an H line, e.g. "H-α" for 3 -> 2, "Ly-β" for 3 -> 1.
line_tableReturn every line's wavelength, emissivity and power.
spectrumReturn the spectral emissivity of lines on the grid wavelength (nm).

doppler_fwhmfunction#

def doppler_fwhm(wavelength: np.ndarray, temperature: float, mass: float) -> np.ndarray

Return the Doppler FWHM in nm of lines at wavelength (nm), kT in eV, mass in kg.

Numerics

fwhm

ΔλFWHM=λ 22ln⁡2 σvc,σv=kTm\Delta\lambda_{\mathrm{FWHM}} = \lambda\, 2\sqrt{2\ln 2}\, \frac{\sigma_v}{c}, \qquad \sigma_v = \sqrt{\frac{kT}{m}}

Assumptions:

  • a Maxwellian of the emitters at TT: σv\sigma_v per velocity component

hydrogen_line_namefunction#

def hydrogen_line_name(upper: int, lower: int) -> str

Return the spectroscopic name of an H line, e.g. "H-α" for 3 -> 2, "Ly-β" for 3 -> 1.

Lines past the Greek alphabet’s twelfth member, or of series beyond Humphreys, are named "<upper>-<lower>".

line_tablefunction#

def line_table(network: ReactionNetwork, rates: np.ndarray, populations: dict[str, float], air: bool = False) -> xr.Dataset

Return every line’s wavelength, emissivity and power.

Parameters

NameTypeDefaultDescription
networkReactionNetworkrequiredThe network.
ratesnp.ndarrayrequiredThe rate coefficients (the escape factors applied).
populationsdict[str, float]requiredEvery state’s density.
airboolFalseWavelengths in standard air above 200 nm instead of vacuum.

Returns

xr.Dataset
A dataset over line (the reaction names) with wavelength (nm),
xr.Dataset
photon_energy (eV), emissivity (photons m^-3 s^-1), power
xr.Dataset
(W m^-3), upper, lower and label.

Numerics

line

E=Eu−El,λ=hcE,ϵ=g Aul nu [photons m−3 s−1],P=ϵ E e [W m−3]E = E_u - E_l, \qquad \lambda = \frac{hc}{E}, \qquad \epsilon = g\,A_{ul}\, n_u \ [\mathrm{photons\ m^{-3}\,s^{-1}}], \qquad P = \epsilon\, E\, e \ [\mathrm{W\,m^{-3}}]

Assumptions:

  • every spontaneous emission u→lu \to l is a line; the escape factor gg is already in the rate
  • photon energies from the state energies; vacuum wavelengths, or in air above 200 nm

Built from:

  • opencr.constants.photon_wavelength
  • opencr.constants.air_wavelength

spectrumfunction#

def spectrum(lines: xr.Dataset, wavelength: np.ndarray, temperature: float | None = None, mass: float = 1.00794 * ATOMIC_MASS, fwhm: float = 0.0, quantity: str = 'power') -> xr.DataArray

Return the spectral emissivity of lines on the grid wavelength (nm).

Each line is a normalised Gaussian whose FWHM is the Doppler width at temperature (eV, of an emitter of mass) and the instrumental fwhm (nm) added in quadrature.

Parameters

NameTypeDefaultDescription
linesxr.DatasetrequiredThe output of line_table.
wavelengthnp.ndarrayrequiredThe grid in nm.
temperaturefloat | NoneNoneThe emitters’ kT in eV; no Doppler broadening if None.
massfloat1.00794 * ATOMIC_MASSThe emitters’ mass in kg.
fwhmfloat0.0The instrumental FWHM in nm.
quantitystr'power'"power" (W m^-3 nm^-1) or "emissivity" (photons m^-3 s^-1 nm^-1).

Numerics

spectrum

ϵλ(λ)=∑linesϵσ2π e−(λ−λ0)2/2σ2,σ=ΔλFWHM22ln⁡2\epsilon_\lambda(\lambda) = \sum_{\mathrm{lines}} \frac{\epsilon}{\sigma\sqrt{2\pi}}\, e^{-(\lambda - \lambda_0)^2/2\sigma^2}, \qquad \sigma = \frac{\Delta\lambda_{\mathrm{FWHM}}}{2\sqrt{2\ln 2}}

width

ΔλFWHM2=ΔλDoppler2+Δλinstrument2\Delta\lambda_{\mathrm{FWHM}}^2 = \Delta\lambda_{\mathrm{Doppler}}^2 + \Delta\lambda_{\mathrm{instrument}}^2

Assumptions:

  • Gaussian lines only: no Stark, Zeeman or natural broadening
  • a line without either width raises

Built from:

  • opencr.analysis.emission.doppler_fwhm