epyr.lineshapes.lorentzian
- epyr.lineshapes.lorentzian(x, center, width, derivative=0, phase=0.0, return_both=False)[source]
Area-normalized Lorentzian lineshape with derivatives and phase rotation.
The Lorentzian profile is fundamental in magnetic resonance, representing homogeneous broadening from finite lifetimes and collision processes.
Parameters:
- xarray
Abscissa points
- centerfloat
Peak center position
- widthfloat
Full width at half maximum (FWHM)
- derivativeint, default=0
Derivative order: - 0: Standard lineshape - 1: First derivative - 2: Second derivative - -1: Integral from -∞
- phasefloat, default=0.0
Phase rotation in radians - 0: Pure absorption - π/2: Pure dispersion
- return_bothbool, default=False
If True, return (absorption, dispersion) tuple
Returns:
- array or tuple
Lorentzian values, optionally with dispersion component
Examples:
>>> x = np.linspace(-10, 10, 1000) >>> # Standard absorption Lorentzian >>> y = lorentzian(x, 0, 4) >>> # First derivative >>> dy = lorentzian(x, 0, 4, derivative=1) >>> # Dispersion mode >>> disp = lorentzian(x, 0, 4, phase=np.pi/2) >>> # Both absorption and dispersion >>> abs_part, disp_part = lorentzian(x, 0, 4, return_both=True)