hyperspy._components.gaussian2d module

class hyperspy._components.gaussian2d.Gaussian2D(A=1.0, sigma_x=1.0, sigma_y=1.0, centre_x=0.0, centre_y=0, module='numexpr', **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:
  • A (float) – Volume (height of the peak scaled by \(2 \pi s_x s_y\)) – eqivalent to the area in a 1D Gaussian.

  • sigma_x (float) – Width (scale parameter) of the Gaussian distribution in x direction.

  • sigma_y (float) – Width (scale parameter) of the Gaussian distribution in y direction.

  • centre_x (float) – Location of the Gaussian maximum (peak position) in x direction.

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

  • add_rotation (bool) – 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.

fwhm_x, fwhm_y

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

Type:

float

property ellipticity

Ratio between the major and minor axis.

Type:

float

property height

Height of the Gaussian

Type:

float

property rotation_angle_wrapped

Rotation angle in radian wrapped to [0, 2*pi]. Only for Gaussian2D component created with add_rotation=True.

Type:

float

property rotation_major_axis

Rotation angle in radian between the major axis (axis with the largest sigma value) and the horizontal axis. Only for Gaussian2D component created with add_rotation=True.

Type:

float

property sigma_major

The sigma value of the major axis (axis with the largest sigma value).

Type:

float

property sigma_minor

The sigma value of the minor axis (axis with the smallest sigma value).

Type:

float