hyperspy._components.doniach module

class hyperspy._components.doniach.Doniach(centre=0.0, A=1.0, sigma=1.0, alpha=0.5, module=['numpy', 'scipy'], **kwargs)

Bases: Expression

Doniach Sunjic lineshape component.

Variable

Parameter

A

sigma

alpha

centre

Parameters
• A (float) – Height

• sigma (float) – Variance parameter of the distribution

• alpha (float) – Tail or asymmetry parameter

• centre (float) – Location of the maximum (peak position).

• **kwargs – Extra keyword arguments are passed to the Expression component.

Note

This is an asymmetric lineshape, originially design for xps but generally useful for fitting peaks with low side tails See Doniach S. and Sunjic M., J. Phys. 4C31, 285 (1970) or http://www.casaxps.com/help_manual/line_shapes.htm for a more detailed description

estimate_parameters(signal, x1, x2, only_current=False)

Estimate the Donach by calculating the median (centre) and the variance parameter (sigma).

Note that an insufficient range will affect the accuracy of this method and that this method doesn’t estimate the asymmetry parameter (alpha).

Parameters
• signal (Signal1D instance) –

• x1 (float) – Defines the left limit of the spectral range to use for the estimation.

• x2 (float) – Defines the right limit of the spectral range to use for the estimation.

• only_current (bool) – If False estimates the parameters for the full dataset.

Returns

Returns True when the parameters estimation is successful

Return type

bool

Examples

>>> g = hs.model.components1D.Lorentzian()
>>> x = np.arange(-10, 10, 0.01)
>>> data = np.zeros((32, 32, 2000))
>>> data[:] = g.function(x).reshape((1, 1, 2000))
>>> s = hs.signals.Signal1D(data)
>>> s.axes_manager[-1].offset = -10
>>> s.axes_manager[-1].scale = 0.01
>>> g.estimate_parameters(s, -10, 10, False)