    Returns a model component given its name.

get_model_component(name)
name - str

When a model component is created, a variable is created that contains the model instance. The instance can also be returned with `get_model_component` , which can then be queried or used to change the model settings:

>>> create_model_component('gauss1d', 'gline') >>> gmodel = get_model_component('gline') >>> gmodel.name 'gauss1d.gline' >>> print([p.name for p in gmodel.pars]) ['fwhm', 'pos', 'ampl'] >>> gmodel.fwhm.val = 12.2 >>> gmodel.fwhm.freeze()

PARAMETERS

The parameter for this function is:

Parameter
Definition
name
The name of the model component.

The return value from this function is:

component -- The model component object.

Notes

The model instances are named as modeltype.username, and it is the username component that is used here to access the instance.

See the bugs pages on the Sherpa website for an up-to-date listing of known bugs.

December 2023