get_par

sherpa.astro.ui.get_par(par: str | Parameter) Parameter

Return a parameter of a model component.

Parameters:
parstr

The name of the parameter, using the format “componentname.parametername”.

Returns:
para sherpa.models.parameter.Parameter instance

The parameter values - e.g. current value, limits, and whether it is frozen - can be changed using this object.

Raises:
sherpa.utils.err.ArgumentErr

If the par argument is invalid: the model component does not exist or the given model has no parameter with that name.

See also

set_par

Set the value, limits, or behavior of a model parameter.

Examples

Return the “c0” parameter of the “bgnd” model component and change it to be frozen:

>>> p = get_par('bgnd.c0')
>>> p.frozen = True