create_template_model

sherpa.models.template.create_template_model(modelname: str, names: list[str], parvals: ndarray, templates: list[TableModelBase], template_interpolator_name: str | None = 'default') TemplateModel | InterpolatingTemplateModel[source] [edit on github]

Create a TemplateModel model class.

Parameters:
modelnamestr

The name of the template model.

namessequence of str

The parameters names.

parvalsndarray

The parameter values, organised as a 2D ndarray of shape (nelem, npars), where nelem is the number of parameter values and npars the number of parameters (which must match the names parameter).

templatessequence of TableModelBase instances

The model for each set of parameters (each row of parvals). It must match the first dimension of parvals.

template_interpolator_namestr or None, optional

The interpolator name. If None then there is no interpolation between templates.

Returns:
modelTemplateModel instance

The template model (may be a subclass of TemplateModel if template_interpolator_name is not None).