SpectralShapeGaussian

class glotaran.builtin.megacomplexes.spectral.shape.SpectralShapeGaussian(*, label: str, type: str = 'gaussian', amplitude: Parameter | str | None = None, location: Parameter | str, width: Parameter | str)[source]

Bases: SpectralShape

A Gaussian spectral shape

Method generated by attrs for class SpectralShapeGaussian.

Attributes Summary

type

amplitude

location

width

label

Methods Summary

calculate

Calculate a normal Gaussian shape for a given axis.

get_item_type

Get the type string.

get_item_type_class

Get the type for a type string.

get_item_types

Get all type strings.

Methods Documentation

amplitude: Parameter | str | None
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

classmethod get_item_type() str

Get the type string.

Return type:

str

classmethod get_item_type_class(item_type: str) Type

Get the type for a type string.

Parameters:

item_type (str) – The type string.

Return type:

Type

classmethod get_item_types() list[str]

Get all type strings.

Return type:

list[str]

label: str
location: Parameter | str
type: str
width: Parameter | str