SpectraUtils

SpectraUtils.jl provides composable building blocks for working with spectral line profiles. The package combines analytic line-shape functions, a convenient Line container, and physical helper formulas for estimating linewidths.

Reference

SpectraUtils.SpectraUtilsModule
SpectraUtils

Utilities for constructing and evaluating spectroscopy line models. The package provides line-shape definitions, convenience helpers for bundling parameters into reusable Line objects, and utilities for estimating linewidths from physical conditions.

source
SpectraUtils.DopplerFreeType
DopplerFree(depth, envelop, dip)

Callable representation of a Doppler-free spectral profile. The resulting shape multiplies a broad envelope envelop(x) by a saturation dip, returning envelop(x) * (1 - depth * dip(x)) when evaluated. The envelop and dip arguments can be any callable line-shape models (for example, Gaussian or Lorentzian).

source
SpectraUtils.GaussianType
Gaussian(sigma)

Callable representation of a Gaussian profile with standard deviation sigma. Call shape(x) to evaluate the profile at offset x.

source
SpectraUtils.LineType
Line(amplitude, position, shape)

Bundle a spectral line definition with an amplitude, position, and callable shape. Each field may be either a numeric value or a function that consumes a parameter set when the line is evaluated. Call the resulting object as line(x, p) to evaluate the profile at a scalar position and as line(xs, p) to broadcast over a vector of positions.

source
SpectraUtils.LorentzianType
Lorentzian(hwhm)

Callable representation of a Lorentzian profile with half-width at half-maximum hwhm. Invoke the object as shape(x) to evaluate the profile at offset x.

source
SpectraUtils.SmithType
Smith(cross_relaxation, sigma, gamma)

Cross-relaxation–broadened line shape following Smith et al. (Phys. Rev. Lett. 26, 740). The profile smoothly blends a normalized Lorentzian–Gaussian product with a Gaussian term according to the dimensionless cross-relaxation factor cross_relaxation ∈ [0, 1]:

(1 - c) * e^{-(γ/2σ)^2}/erfc(γ/2σ) * (γ/π)/(x^2 + γ^2) * e^{-x^2/4σ^2}
  + c * Gaussian(x, σ)

The parameters are the Gaussian standard deviation sigma, the Lorentzian half-width at half-maximum gamma, and the mixing factor cross_relaxation. The analytic prefactor ensures the profile integrates to one for any parameter values.

source
SpectraUtils.VoigtMethod
Voigt(sigma, gamma)

Callable representation of the full Voigt profile with standard deviation sigma and Lorentzian half-width gamma. Evaluate using shape(x) to compute the line shape at offset x.

source
SpectraUtils.VoigtApprxType
VoigtApprx(sigma, gamma)

Pseudo-Voigt approximation that blends Gaussian and Lorentzian profiles with standard deviation sigma and half-width at half-maximum gamma. Evaluate instances as shape(x) to compute the approximated Voigt profile at offset x.

source
SpectraUtils.gamma_hard_sphereMethod
gamma_hard_sphere(p, T; μ, cs)

Compute the Lorentzian half-width at half-maximum (in cm⁻¹) under the hard-sphere collisional model. The calculation uses the pressure p (Pa), temperature T (K), reduced mass μ (kg), and average relative speed cs (m/s).

source
SpectraUtils.sigma_dopplerMethod
sigma_doppler(f0, T; m)

Return the Doppler Gaussian standard deviation for a transition at frequency f0 and temperature T (in kelvin). The molecular mass m is supplied as a keyword argument and should be expressed in kilograms.

source