slmsuite.holography.analysis.fitfunctions.lorentzian#
- lorentzian(x, x0, a, c, Q)[source]#
For fitting a resonance. There are many ways to describe a Lorentzian. Commonly, a full-width-half-maximum definition is used. Here, with roots in photonic crystal cavities, we use a form defined using the quality factor \(Q\) of the resonance.
\[y(x) = c + \frac{a}{1 + \left[\frac{x - x_0}{x_0/2Q}\right]^2}.\]- Parameters:
x (numpy.ndarray) – Points to fit upon.
x0 (float) – Center wavelength.
a (float) – Amplitude.
c (float) – Constant offset.
Q (float) – Quality factor.
- Returns:
y – Lorentzian fit evaluated at all
x.- Return type:
numpy.ndarray