scippneutron.peaks.model.GaussianModel#

class scippneutron.peaks.model.GaussianModel(*, prefix='')[source]#

A Gaussian function with arbitrary normalization.

The model implements

\[f(x; A, \mu, \sigma) = \frac{A}{\sqrt{2\pi}\sigma} \exp{\left(-\frac{{(x-\mu)}^2}{2\sigma^2}\right)}\]

with parameters

  • \(A\): 'amplitude'

  • \(\mu\): 'loc'

  • \(\sigma\): 'scale'

__init__(*, prefix='')[source]#

Initialize a Gaussian model.

Parameters:

prefix (str, default: '') – Prefix for model parameter names.

Methods

__init__(*[, prefix])

Initialize a Gaussian model.

fwhm(params)

Compute full width at half maximum.

guess(data, *[, coord])

Roughly estimate the model parameters for given data.

with_prefix(prefix)

Return a copy of the model with a new prefix.

Attributes

param_bounds

Parameter bounds.

param_names

Parameter names including the prefix.

prefix

Prefix for parameter names.

fwhm(params)[source]#

Compute full width at half maximum.

Parameters:

params (dict[str, Variable]) – Parameter values for which to compute the FWHM.

Returns:

Variable – FWHM of the model at the given parameters.