Const_1GaussModel

class threadcount.models.Const_1GaussModel(independent_vars=['x'], prefix='', nan_policy='raise', **kwargs)[source]

Bases: CompositeModel

Constant + 1 Gaussian Model.

Essentially created by:

lmfit.models.ConstantModel() + GaussianModelH(prefix="g1_")

The param names are [‘g1_height’, ‘g1_center’, ‘g1_sigma’, ‘c’]

Parameters:
  • independent_vars (list of str, optional) – Arguments to the model function that are independent variables default is [‘x’]).

  • prefix (str, optional) – String to prepend to parameter names, needed to add two Models that have parameter names in common.

  • nan_policy ({'raise', 'propagate', 'omit'}, optional) – How to handle NaN and missing values in data. See Notes below.

  • **kwargs (optional) – Keyword arguments to pass to Model.

Notes

1. nan_policy sets what to do when a NaN or missing value is seen in the data. Should be one of:

  • ‘raise’ : raise a ValueError (default)

  • ‘propagate’ : do nothing

  • ‘omit’ : drop missing data

Methods Summary

guess(data, x, **kwargs)

Estimate initial model parameter values from data.

Methods Documentation

guess(data, x, **kwargs)

Estimate initial model parameter values from data.

The data for gaussian g1 will be guessed by 1 gaussian plus constant.

a and b model parameters are initialized by any model parameter hint and not affected by the guess function.

Parameters:
  • data (array_like) – Array of data (i.e., y-values) to use to guess parameter values.

  • x (array_like) – Array of values for the independent variable (i.e., x-values).

  • **kws (optional) – Additional keyword arguments, passed to model function.

Returns:

params – Initial, guessed values for the parameters of a Model.

Return type:

Parameters