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.

\[ f(x) = \frac{A \cos[ \frac{{\pi\alpha}}{2}+ (1-\alpha)\tan^{-1}(\frac{x-centre+dx}{\sigma})]} {(\sigma^2 + (x-centre+dx)^2)^{\frac{(1-\alpha)}{2}}} \] \[ dx = \frac{2.354820\sigma}{2 tan[\frac{\pi}{2-\alpha}]} \]

Variable

Parameter

\(A\)

A

\(\sigma\)

sigma

\(\alpha\)

alpha

\(centre\)

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)