SpectralShapeSkewedGaussian

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

Bases: SpectralShapeGaussian

A skewed Gaussian spectral shape

Method generated by attrs for class SpectralShapeSkewedGaussian.

Attributes Summary

type

skewness

amplitude

location

width

label

Methods Summary

calculate

Calculate the skewed Gaussian shape for 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: ParameterType | None
calculate(axis: ndarray) ndarray[source]

Calculate the skewed Gaussian shape for axis.

The following equation is used for the calculation:

f(x, x_0, A, \Delta, b) =
\left\{
    \begin{array}{ll}
        0                                               & \mbox{if } \theta \leq 0 \\
        A \exp \left({- \dfrac{\log{\left(2 \right)}
        \log{\left(\theta(x, x_0, \Delta, b) \right)}^{2}}{b^{2}}}\right)
                                                        & \mbox{if } \theta > 0
    \end{array}
\right.

With:

\theta(x, x_0, \Delta, b) = \frac{2 b \left(x - x_{0}\right) + \Delta}{\Delta}

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

  • x : axis

  • A : amplitude

  • x_0 : location

  • \Delta : width

  • b : skewness

Where \Delta represents the full width at half maximum (FWHM), see calculate_gaussian().

Note that in the limit of skewness parameter b equal to zero f(x, x_0, A, \Delta, b) simplifies to a normal gaussian (since \lim_{b \to 0} \frac{\ln(1+bx)}{b}=x), see the definition in SpectralShapeGaussian.calculate().

Parameters:

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

Returns:

An array representing a skewed 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: ParameterType
skewness: Parameter | str
type: str
width: ParameterType