qspec logo qspec logo

A physics toolbox for laser spectroscopy.

Static Badge Static Badge Static Badge

Static Badge Static Badge

© 2026 Patrick Müller. All rights reserved.

qspec.models. Convolved  (  model=None ,  model_1=None  )[source]

A generic numerical convolution of two models $g$ and $h$

$$ f(x) = \int g(x - t)h(t)\,\mathrm{d}t, $$

integrated with the trapezoidal rule over the x-axis interval of $h$. The parameters of $h$ are appended with the suffix "(conv)". If only one of the models is specified, the convolution returns that model.

Parameters:
modelModel | None

The first model $g$ to convolve.

model_1Model | None

The second model $h$ to convolve, i.e., the convolution kernel.

Attributes:
descriptionstr

A description of the model hierarchy, e.g., "Offset.Summed[0].Hyperfine.Voigt".

dxfloat

A hint for an x-axis step size for a smooth display of the model.

errorstr

An error message if there is an issue with the model parameters (not implemented).

fixeslist[fix_type]

The fix states of the parameters, see Model.set_fix.

linkslist[bool]

Whether the parameters are linked to the parameters with the same name in a Linked model.

modelModel | None

The submodel.

nameslist[str]

The names of the parameters.

pdict[str, int]

A map of the parameter names to their indexes.

sizeint

The number of parameters required by the model.

typestr

The name of the model type.

valslist[float]

The current values of the parameters.

Raises:
ValueError

If both model and model_1 are None.