Available line profiles

Line Profiles

This module implements all emission- and absorption-line profile functions available in sheap. These functions define the mathematical shapes of spectral lines (Gaussian, Lorentzian, Voigt, skewed Gaussian, EMG, etc.) and provide consistent JAX-compatible implementations for fitting routines.

Profiles are parameterized in terms of log-amplitude, center, and width measures (FWHM, sigma, gamma), with extensions for skewness, exponential decay, or Hermite expansions.

Functions

  • gaussian_fwhm : Standard Gaussian profile with FWHM parameterization.

  • lorentzian_fwhm : Lorentzian profile with FWHM.

  • voigt_pseudo : Pseudo-Voigt (linear combination of Gaussian and Lorentzian).

  • skewed_gaussian : Skew-normal Gaussian with shape parameter α.

  • emg_fwhm : Exponentially Modified Gaussian (Gaussian ⊗ exponential decay).

  • top_hat : Rectangular (boxcar) profile.

  • eval_hermite : Recursive Hermite polynomial evaluator.

  • gauss_hermite_losvd_jax : Gauss–Hermite line-of-sight velocity distribution.

Notes

  • All profiles are decorated with @with_param_names to provide

    consistent parameter naming across the codebase.

  • Amplitudes are expressed in base-10 logarithmic form (amplitude),

    so physical scaling is applied as amplitude.

  • Functions are written in JAX and fully differentiable, suitable for

    gradient-based fitting and uncertainty propagation.

Examples

import jax.numpy as jnp
from sheap.Profiles.profiles_line import gaussian_fwhm

x = jnp.linspace(6500, 6600, 1000)
params = jnp.array([0.0, 6563.0, 10.0])  # logamp=0 → amp=1, center=6563Å, FWHM=10Å
y = gaussian_fwhm(x, params)
emg_fwhm(x, params)[source]

Exponentially Modified Gaussian (EMG) profile.

\[f(x) = \frac{A \cdot \lambda}{2} \cdot \exp\left( \frac{\lambda}{2}(2\mu + \lambda\sigma^2 - 2x) \right) \cdot \mathrm{erfc}\left( \frac{\mu + \lambda\sigma^2 - x}{\sqrt{2}\sigma} \right)\]

where: - \(A = 10^{\mathrm{amplitude}}\) - \(\sigma = \mathrm{fwhm} / 2.355\)

Parameters:
  • x (jnp.ndarray) – Input wavelength array.

  • params (array-like) –

    • amplitude: Log base-10 amplitude.

    • center: Gaussian mean (μ).

    • fwhm: Gaussian full width at half maximum.

    • lambda: Exponential decay rate (1/τ).

Returns:

Profile evaluated at x.

Return type:

jnp.ndarray

eval_hermite(n, x)[source]

Evaluate the physicist’s Hermite polynomial \(H_n(x)\) recursively using JAX.

The recurrence relation is: .. math:

H_0(x) = 1 \\
H_1(x) = 2x \\
H_n(x) = 2x \cdot H_{n-1}(x) - 2(n-1) \cdot H_{n-2}(x)
Parameters:
  • n (int) – Order of the Hermite polynomial.

  • x (jnp.ndarray) – Input array where the polynomial is evaluated.

Returns:

Values of \(H_n(x)\) with same shape as x.

Return type:

jnp.ndarray

gauss_hermite_losvd_jax(v, v0, sigma, h3=0.0, h4=0.0)[source]

Line-of-sight velocity distribution (LOSVD) using Gauss-Hermite expansion.

Based on van der Marel & Franx (1993) formulation:

\[\mathcal{L}(v) = \frac{1}{\sqrt{2\pi} \sigma} \exp\left(-\frac{(v - v_0)^2}{2\sigma^2}\right) \cdot \left[ 1 + h_3 H_3(x) + h_4 H_4(x) \right]\]

where: - \(x = \frac{v - v_0}{\sigma}\) - \(H_3(x)\) and \(H_4(x)\) are normalized Hermite polynomials. - Output is normalized to integrate to 1.

Parameters:
  • v (jnp.ndarray) – Velocity grid in km/s or appropriate units.

  • v0 (float) – Mean velocity (center).

  • sigma (float) – Standard deviation of the Gaussian core.

  • h3 (float, optional) – Third Gauss-Hermite coefficient (skewness).

  • h4 (float, optional) – Fourth Gauss-Hermite coefficient (kurtosis).

Returns:

Normalized LOSVD array with same shape as v.

Return type:

jnp.ndarray

gaussian_fwhm(x, params)[source]

Standard Gaussian line profile using FWHM.

\[f(x) = A \cdot \exp\left( -\frac{1}{2} \left( \frac{x - \mu}{\sigma} \right)^2 \right)\]

where: - \(A = 10^{\mathrm{amplitude}}\) - \(\sigma = \mathrm{fwhm} / 2.355\)

Parameters:
  • x (jnp.ndarray) – Input wavelength array.

  • params (array-like) –

    • amplitude: Log base-10 amplitude.

    • center: Line center.

    • fwhm: Full width at half maximum.

Returns:

Profile evaluated at x.

Return type:

jnp.ndarray

lorentzian_fwhm(x, params)[source]

Lorentzian line profile using FWHM.

\[f(x) = \frac{A}{1 + \left( \frac{x - \mu}{\gamma} \right)^2 }\]

where: - \(A = 10^{\mathrm{amplitude}}\) - \(\gamma = \mathrm{fwhm} / 2\)

Parameters:
  • x (jnp.ndarray) – Input wavelength array.

  • params (array-like) –

    • amplitude: Log base-10 amplitude.

    • center: Line center.

    • fwhm: Full width at half maximum.

Returns:

Profile evaluated at x.

Return type:

jnp.ndarray

skewed_gaussian(x, params)[source]

Skewed Gaussian profile using the Azzalini formulation.

\[f(x) = 2A \cdot \phi(t) \cdot \Phi(\alpha t)\]

where: - \(t = \frac{x - \mu}{\sigma}\) - \(\phi(t)\) is the standard normal PDF - \(\Phi(t)\) is the standard normal CDF - \(\sigma = \mathrm{fwhm} / 2.355\)

Parameters:
  • x (jnp.ndarray) – Input wavelength array.

  • params (array-like) –

    • amplitude: Log base-10 amplitude.

    • center: Mean of the Gaussian.

    • fwhm: Full width at half maximum.

    • alpha: Skewness parameter.

Returns:

Profile evaluated at x.

Return type:

jnp.ndarray

top_hat(x, params)[source]

Rectangular (top-hat) function.

\[f(x) = A \quad \text{if } |x - \mu| \leq \frac{w}{2}; \quad 0 \text{ otherwise}\]

where: - \(A = 10^{\mathrm{amplitude}}\) - \(\mu = \text{center}\) - \(w = \text{width}\)

Parameters:
  • x (jnp.ndarray) – Input wavelength array.

  • params (array-like) –

    • amplitude: Log base-10 amplitude.

    • center: Center of the box.

    • width: Width of the top-hat.

Returns:

Profile evaluated at x.

Return type:

jnp.ndarray

voigt_pseudo(x, params)[source]

Pseudo-Voigt profile (weighted sum of Gaussian and Lorentzian).

\[f(x) = A \cdot \left[ \eta \cdot L(x) + (1 - \eta) \cdot G(x) \right]\]

where: - \(A = 10^{\mathrm{amplitude}}\) - \(\sigma = \mathrm{fwhm_g} / 2.355\) - \(\gamma = \mathrm{fwhm_l} / 2\) - \(\eta\) is an empirical function of \(\gamma\) and \(\sigma\)

Parameters:
  • x (jnp.ndarray) – Input wavelength array.

  • params (array-like) –

    • amplitude: Log base-10 amplitude.

    • center: Line center.

    • fwhm_g: Gaussian FWHM.

    • fwhm_l: Lorentzian FWHM.

Returns:

Profile evaluated at x.

Return type:

jnp.ndarray