perturbopy.postproc.utils.spectra_plots.find_fwhm
- perturbopy.postproc.utils.spectra_plots.find_fwhm(x, y, num_interp_points=2000)
Find the Full Width at Half Maximum (FWHM) for a single prominent peak y(x), using an Akima1DInterpolator to create a smooth spline, and root-finding (brentq) for a precise half-max crossing.
- Parameters:
x (array_like) – 1D array of x-values (assumed sorted in ascending order).
y (array_like) – 1D array of y-values corresponding to x.
num_interp_points (int, optional) – Number of points for evaluating the Akima spline; default is 2000.
- Returns:
x_left (float) – x-value at the left FWHM crossing.
x_right (float) – x-value at the right FWHM crossing.
half_max (float) – Half-maximum value of the peak.