utility
- maxwellbloch.utility.full_width_at_half_max(x: ndarray, y: ndarray) float[source]
Return the full width at half maximum (FWHM) of a peak.
- Parameters:
x – 1-D array of independent variable values (must be monotonically increasing and have enough points for spline fitting).
y – 1-D array of dependent variable values, same length as
x.
- Returns:
the distance between the two points where
yequals half its maximum value.- Return type:
The FWHM as a scalar
- maxwellbloch.utility.half_max_roots(x: ndarray, y: ndarray) tuple[float, float, float][source]
Return the half-maximum value and the two roots where
ycrosses it.- Parameters:
x – 1-D array of independent variable values (must be monotonically increasing and have enough points for spline fitting).
y – 1-D array of dependent variable values, same length as
x.
- Returns:
Tuple
(half_max, r1, r2)wherehalf_max = max(y) / 2andr1 < r2are the two x-values wherey == half_max.
- maxwellbloch.utility.maxwell_boltzmann(v: ndarray, fwhm: float, offset: float = 0.0) ndarray[source]
Maxwell-Boltzmann probability distribution.
- Parameters:
v – velocity (or detuning) values.
fwhm – full-width at half-maximum of the distribution.
offset – centre of the distribution (default 0).
- Returns:
Probability density at each value in
v.