gaussian#

torchspin.gaussian(x, x0, fwhm, diff=0, phase=0.0)[source]#

Area-normalized Gaussian absorption (and dispersion) lineshape.

Parameters:
  • x (array_like) – Abscissa values (any units).

  • x0 (float) – Center of the lineshape.

  • fwhm (float) – Full width at half maximum (same units as x). Must be > 0.

  • diff (int, optional) – Derivative order. 0 = absorption, 1 = first derivative, 2 = second, etc.; -1 = cumulative integral from -∞. Default 0.

  • phase (float, optional) – Phase rotation in radians; mixes absorption and dispersion. phase=π/2 puts the dispersion into the first return value. Default 0.

Returns:

  • ya (ndarray) – Absorption lineshape (or phase-rotated combination).

  • yd (ndarray) – Dispersion lineshape (same shape as ya).

Return type:

tuple

Notes

Dispersion uses the Dawson function F(x) (scipy.special.dawsn). Higher-order dispersion derivatives use the Barakat (1971) recurrence.