calculate

SpectralShapeGaussian.calculate(axis: ndarray) ndarray[source]

Calculate a normal Gaussian shape for a given axis.

The following equation is used for the calculation:

f(x, A, x_0, \Delta) = A \exp \left({-
\frac{
    \log{\left(2 \right)
    \left(2(x - x_{0})\right)^{2}
}}{\Delta^{2}}}\right)

The parameters of the equation represent the following attributes of the shape:

  • x : axis

  • A : amplitude

  • x_0 : location

  • \Delta : width

In this formalism, \Delta represents the full width at half maximum (FWHM). Compared to the more common definition \exp \left(- (x-\mu )^{2}/(2\sigma^{2})\right) we have \sigma = \Delta/(2\sqrt{2\ln(2)})=\Delta/2.35482

Parameters:

axis (np.ndarray) – The axis to calculate the shape for.

Returns:

An array representing a Gaussian shape.

Return type:

np.ndarray