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
| Name | Description |
|---|---|
doppler_fwhm | Return the Doppler FWHM in nm of lines at wavelength (nm), kT in eV, mass in kg. |
hydrogen_line_name | Return the spectroscopic name of an H line, e.g. "H-α" for 3 -> 2, "Ly-β" for 3 -> 1. |
line_table | Return every line's wavelength, emissivity and power. |
spectrum | Return the spectral emissivity of lines on the grid wavelength (nm). |
doppler_fwhmfunction#
def doppler_fwhm(wavelength: np.ndarray, temperature: float, mass: float) -> np.ndarrayReturn the Doppler FWHM in nm of lines at wavelength (nm), kT in eV, mass in kg.
Numerics
fwhm
Assumptions:
- a Maxwellian of the emitters at : per velocity component
hydrogen_line_namefunction#
def hydrogen_line_name(upper: int, lower: int) -> strReturn 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.DatasetReturn every line’s wavelength, emissivity and power.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
network | ReactionNetwork | required | The network. |
rates | np.ndarray | required | The rate coefficients (the escape factors applied). |
populations | dict[str, float] | required | Every state’s density. |
air | bool | False | Wavelengths in standard air above 200 nm instead of vacuum. |
Returns
xr.Dataset- A dataset over
line(the reaction names) withwavelength(nm), xr.Datasetphoton_energy(eV),emissivity(photons m^-3 s^-1),powerxr.Dataset- (W m^-3),
upper,lowerandlabel.
Numerics
line
Assumptions:
- every spontaneous emission is a line; the escape factor is already in the rate
- photon energies from the state energies; vacuum wavelengths, or in air above 200 nm
Built from:
opencr.constants.photon_wavelengthopencr.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.DataArrayReturn 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
| Name | Type | Default | Description |
|---|---|---|---|
lines | xr.Dataset | required | The output of line_table. |
wavelength | np.ndarray | required | The grid in nm. |
temperature | float | None | None | The emitters’ kT in eV; no Doppler broadening if None. |
mass | float | 1.00794 * ATOMIC_MASS | The emitters’ mass in kg. |
fwhm | float | 0.0 | The instrumental FWHM in nm. |
quantity | str | 'power' | "power" (W m^-3 nm^-1) or "emissivity" (photons m^-3 s^-1 nm^-1). |
Numerics
spectrum
width
Assumptions:
- Gaussian lines only: no Stark, Zeeman or natural broadening
- a line without either width raises
Built from:
opencr.analysis.emission.doppler_fwhm