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

set_par(par, val=None, min=None, max=None, frozen=None)
par - str
val - number, optional
min - number, optional
max - number, optional
frozen - bool, optional

Change the parameter value to 23.

>>> set_par('bgnd.c0', 23)

Restrict the line.ampl parameter to be between 1e-4 and 10 and to have a value of 0.1.

>>> set_par('line.ampl', 0.1, min=1e-4, max=10)

PARAMETERS

The parameters for this function are:

Parameter
Definition
par
The name of the parameter, using the format "componentname.parametername".
val
Change the current value of the parameter.
min
Change the minimum value of the parameter (the soft limit).
max
Change the maximum value of the parameter (the soft limit).
frozen
Freeze ( True ) or thaw ( False ) the parameter.

Notes

The parameter object can be used to change these values directly, by setting the attribute with the same name as the argument - so that:

set_par('emis.flag', val=2, frozen=True)

is the same as:

emis.flag.val = 2 emis.flag.frozen = True

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

December 2023