epyr.lineshapes.lshape
- epyr.lineshapes.lshape(x, center, width, derivative=0, alpha=1.0, phase=0.0)[source]
General normalized lineshape function.
Computes a linear combination of Gaussian and Lorentzian lineshapes: alpha * Gaussian + (1-alpha) * Lorentzian
This creates pseudo-Voigt profiles commonly used in spectroscopy.
Parameters:
- xarray
Abscissa points
- centerfloat
Peak center position
- widthfloat or (float, float)
Full width at half maximum If single value: same width for both components If tuple: (gaussian_width, lorentzian_width)
- derivativeint, default=0
Derivative order (0=function, 1=first derivative, 2=second, -1=integral)
- alphafloat, default=1.0
Mixing parameter (0=pure Lorentzian, 1=pure Gaussian)
- phasefloat, default=0.0
Phase rotation (0=absorption, π/2=dispersion)
Returns:
- array
Lineshape values
Examples:
>>> x = np.linspace(-10, 10, 1000) >>> # Pure Gaussian >>> gauss = lshape(x, 0, 5, alpha=1.0) >>> # Pure Lorentzian >>> lorentz = lshape(x, 0, 5, alpha=0.0) >>> # 50/50 mix (pseudo-Voigt) >>> mixed = lshape(x, 0, 5, alpha=0.5) >>> # Different widths for each component >>> mixed_widths = lshape(x, 0, (3, 7), alpha=0.3)