Voigt1D¶
-
class
astropy.modeling.functional_models.
Voigt1D
[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 thefixed
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 thetied
property of a parameter may be used.bounds : dict
eqcons : list
A list of functions of length
n
such thateqcons[j](x0,*args) == 0.0
in a successfully optimized problem.ineqcons : list
A list of functions of length
n
such thatieqcons[j](x0,*args) >= 0.0
is a successfully optimized problem.See also
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()
(Source code, png, hires.png, pdf)
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]¶
-