components2D#

Components that can be used to define a 2D model for e.g. curve fitting.

Writing a new template is easy, see the user guide documentation on creating components.

For more details see each component docstring.#

Expression

Create a component from a string expression.

Gaussian2D

Normalized 2D elliptical Gaussian function component.

class hyperspy.api.model.components2D.Gaussian2D(A=1.0, sigma_x=1.0, sigma_y=1.0, centre_x=0.0, centre_y=0, module=None, **kwargs)#

Bases: Expression

Normalized 2D elliptical Gaussian function component.

\[f(x,y) = \frac{A}{2\pi s_x s_y}\exp\left[-\frac{\left(x-x_0\right) ^{2}}{2s_{x}^{2}}\frac{\left(y-y_0\right)^{2}}{2s_{y}^{2}}\right]\]

Variable

Parameter

\(A\)

A

\(s_x,s_y\)

sigma_x/y

\(x_0,y_0\)

centre_x/y

Parameters:
Afloat

Volume (height of the peak scaled by \(2 \pi s_x s_y\)) – eqivalent to the area in a 1D Gaussian.

sigma_xfloat

Width (scale parameter) of the Gaussian distribution in x direction.

sigma_yfloat

Width (scale parameter) of the Gaussian distribution in y direction.

centre_xfloat

Location of the Gaussian maximum (peak position) in x direction.

centre_xfloat

Location of the Gaussian maximum (peak position) in y direction.

add_rotationbool

If True, add the parameter rotation_angle corresponding to the angle between the x and the horizontal axis.

**kwargs

Extra keyword arguments are passed to the Expression component.

Attributes:
fwhm_x, fwhm_yfloat

Convenience attributes to get and set the full width at half maximum along the two axes.

Parameters:
parameter_name_listlist

The list of parameter names.

linear_parameter_listlist, optional

The list of linear parameter. The default is None.