Standard Fitting Models

Linear

  • m - Gradient

  • c - (y) Intercept

\[y = mx + c\]

Polynomial

  • ad - Polynomial coefficients

For a polynomial degree n:

\[y = ax^n + bx^n-1 + ... + cx^1 + d \]

Gaussian

  • amp - The maximum height of the Gaussian above background

  • sigma - A scalar for Gaussian width

  • x0 - The centre (x) of the Gaussian

  • background - The minimum value (y) of the Gaussian

\[y = \text{amp} * e^{-\frac{(x - x0) ^ 2}{2 * \text{sigma}^2}} + \text{background}\]

GaussianModel

Lorentzian

  • amp - The maximum height of the Lorentzian above background

  • sigma - A scalar for Lorentzian width

  • center - The centre (x) of the Lorentzian

  • background - The minimum value (y) of the Lorentzian

\[y = \frac{\text{amp}}{1 + \frac{x - \text{center}}{\text{sigma}}^2} + \text{background}\]

LorentzianModel

Damped Oscillator (DampedOsc)

  • center - The centre (x) of the oscillation

  • amp - The maximum height of the curve above 0

  • freq - The frequency of the oscillation

  • width - How far away from the centre will oscillations last for

\[y = \text{amp} * \cos((x - \text{center}) * \text{freq}) * e^{-\frac{x - \text{center}}{\text{width}^ 2}}\]

DampedOscModel

Slit Scan (SlitScan)

  • background \(b\) - The minimum value (y) of the model

  • inflection0 \(i_0\) - The x coord of the first inflection point

  • gradient \(g\) - The gradient of the sloped-linear section of the model

  • inflections_diff \(i_{\Delta}\) - The x displacement between the two inflection points

  • height_above_inflection1 \(h_1\) - The y displacement between inflection 1 and the model’s asymptote

\[\text{exp_seg} = h_1 \cdot \text{erf} \left( g \cdot \frac{\sqrt{\pi}}{2h_1} \cdot (x - i_0 - \Delta i) \right) + g \cdot \Delta i + b\]
\[\text{lin_seg} = \max(b + g * (x - i_0), b)\]
\[y = \min(\text{lin_seg}, \text{exp_seg})\]

SlitScanModel

Error Function (ERF)

  • cen - The centre (x) of the model

  • stretch - A horizontal stretch factor for the model

  • scale - A vertical stretch factor for the model

  • background - The minimum value (y) of the model

\[y = background + scale * erf(stretch * (x - cen))\]

ERFModel

Complementary Error Function (ERFC)

  • cen - The centre (x) of the model

  • stretch - A horizontal stretch factor for the model

  • scale - A vertical stretch factor for the model

  • background - The minimum value (y) of the model

\[y = background + scale * erfc(stretch * (x - cen))\]

ERFCModel

Top Hat (TopHat)

  • cen - The centre (x) of the model

  • width - How wide the ‘hat’ is

  • height - The maximum height of the model above background

  • background - The minimum value (y) of the model

\[\begin{split}y = \begin{cases} \text{background} + \text{height}, & \text{if } |x - \text{cen}| < \frac{\text{width}}{2} \\ \text{background}, & \text{otherwise} \end{cases}\end{split}\]

TopHatModel

Trapezoid

  • cen - The centre (x) of the model

  • gradient - How steep the edges of the trapezoid are

  • height - The maximum height of the model above background

  • background - The minimum value (y) of the model

  • y_offset - Acts as a width factor for the trapezoid. If you extrapolate the sides of the trapezoid until they meet above the top, this value represents the y coord of this point minus height and background.

\[f(x) = \text{y_offset} + \text{height} + \text{background} - \text{gradient} * |x - \text{cen}|\]
\[g(x) = \max(f(x), \text{background})\]
\[y = \min(g(x), \text{background} + \text{height})\]

TrapezoidModel