create_template_model

sherpa.models.template.create_template_model(modelname, names, parvals, templates, template_interpolator_name='default')[source] [edit on github]

Create a TemplateModel model class.

Parameters:
  • modelname (str) – The name of the template model.

  • names (sequence of str) – The parameters names.

  • parvals (ndarray) – 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).

  • templates (sequence of TableModel instances) – The model for each set of parameters (each row of parvals). It must match the first dimension of parvals.

  • template_interpolator_name (str or None, optional) – The interpolator name. If None then there is no interpolation between templates.

Returns:

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

Return type:

TemplateModel instance