Voigt1D

class astropy.modeling.functional_models.Voigt1D(x_0=0, amplitude_L=1, fwhm_L=0.6366197723675814, fwhm_G=0.69314718055994529, **kwargs)[source] [edit on github]

Bases: astropy.modeling.Fittable1DModel

One dimensional model for the Voigt profile.

Parameters:

x_0 : float

Position of the peak

amplitude_L : float

The Lorentzian amplitude

fwhm_L : float

The Lorentzian full width at half maximum

fwhm_G : float

The Gaussian full width at half maximum

Other Parameters:
 

fixed : a dict

A dictionary {parameter_name: boolean} of parameters to not be varied during fitting. True means the parameter is held fixed. Alternatively the fixed property of a parameter may be used.

tied : dict

A dictionary {parameter_name: callable} of parameters which are linked to some other parameter. The dictionary values are callables providing the linking relationship. Alternatively the tied property of a parameter may be used.

bounds : dict

A dictionary {parameter_name: boolean} of lower and upper bounds of parameters. Keys are parameter names. Values are a list of length 2 giving the desired range for the parameter. Alternatively the min and max properties of a parameter may be used.

eqcons : list

A list of functions of length n such that eqcons[j](x0,*args) == 0.0 in a successfully optimized problem.

ineqcons : list

A list of functions of length n such that ieqcons[j](x0,*args) >= 0.0 is a successfully optimized problem.

See also

Gaussian1D, Lorentz1D

Notes

Algorithm for the computation taken from McLean, A. B., Mitchell, C. E. J. & Swanston, D. M. Implementation of an efficient analytical approximation to the Voigt function for photoemission lineshape analysis. Journal of Electron Spectroscopy and Related Phenomena 69, 125-132 (1994)

Examples

import numpy as np
from astropy.modeling.models import Voigt1D
import matplotlib.pyplot as plt

plt.figure()
x = np.arange(0, 10, 0.01)
v1 = Voigt1D(x_0=5, amplitude_L=10, fwhm_L=0.5, fwhm_G=0.9)
plt.plot(x, v1(x))
plt.show()

(png, svg, pdf)

../_images/astropy-modeling-functional_models-Voigt1D-1.png

Attributes Summary

amplitude_L
fwhm_G
fwhm_L
param_names
x_0

Methods Summary

evaluate(x, x_0, amplitude_L, fwhm_L, fwhm_G)
fit_deriv(x, x_0, amplitude_L, fwhm_L, fwhm_G)

Attributes Documentation

amplitude_L
fwhm_G
fwhm_L
param_names = ('x_0', 'amplitude_L', 'fwhm_L', 'fwhm_G')
x_0

Methods Documentation

classmethod evaluate(x, x_0, amplitude_L, fwhm_L, fwhm_G)[source] [edit on github]
classmethod fit_deriv(x, x_0, amplitude_L, fwhm_L, fwhm_G)[source] [edit on github]