mcetl.fitting.models

Provides additional models for fitting data.

@author : Donald Erb Created on Nov 29, 2020

Module Contents

Classes

BreitWignerFanoModel

A modified version of lmfit's BreitWignerModel.

Functions

breit_wigner_fano_alt

An alternate Breit-Wigner-Fano lineshape that uses height rather than amplitude.

class mcetl.fitting.models.BreitWignerFanoModel(independent_vars=['x'], prefix='', nan_policy='raise', **kwargs)

Bases: lmfit.model.Model

A modified version of lmfit's BreitWignerModel.

Initializes with q=-3 rather than q=1, which gives a better peak. Also defines terms for fwhm, height, x_mode, and maximum that were not included in lmfit's implementation, where x_mode is the x position at the maximum y-value, and maximum is the maximum y-value. Further, the lmfit implementation uses amplitude as value for bwf as abs(x) approaches infinity, which is different than for most other peaks where amplitude is defined as the peak area.

Compared to lmfit's implementation, height = amplitude * q**2, and sigma (this model) = sigma (lmfit) / 2.

guess(self, data, x=None, negative=False, **kwargs)

Estimate initial model parameter values from data.

mcetl.fitting.models.breit_wigner_fano_alt(x, height=1.0, center=0.0, sigma=1.0, q=- 3.0)

An alternate Breit-Wigner-Fano lineshape that uses height rather than amplitude.

breit_wigner_fano(x, height, center, sigma, q) =

height * (1 + (x - center) / (q * sigma))**2 / (1 + ((x - center) / sigma)**2)