    Add parameter information to a user model.

add_user_pars(modelname, parnames, parvals=None, parmins=None, parmaxs=None, parunits=None, parfrozen=None)
modelname - str
parnames - array of str
parvals - array of number, optional
parmins - array of number, optional
parmaxs - array of number, optional
parunits - array of str, optional
parfrozen - array of bool, optional

Create a user model for the function `profile` called "myprof", which has two parameters called "core" and "ampl", both of which will start with a value of 0.

>>> load_user_model(profile, "myprof") >>> add_user_pars("myprof", ["core", "ampl"])

Set the starting values, minimum values, and whether or not the parameter is frozen by default, for the "prof" model:

>>> pnames = ["core", "ampl", "intflag"] >>> pvals = [10, 200, 1] >>> pmins = [0.01, 0, 0] >>> pfreeze = [False, False, True] >>> add_user_pars("prof", pnames, pvals, ... parmins=pmins, parfrozen=pfreeze)

PARAMETERS

The parameters for this function are:

Parameter
Definition
modelname
The name of the user model (created by `load_user_model` ).
parnames
The names of the parameters. The order of all the parameter arrays must match that expected by the model function (the first argument to `load_user_model` ).
parvals
The default values of the parameters. If not given each parameter is set to 0.
parmins
The minimum values of the parameters (hard limit). The default value is -3.40282e+38.
parmaxs
The maximum values of the parameters (hard limit). The default value is 3.40282e+38.
parunits
The units of the parameters. This is only used in screen output (i.e. is informational in nature).
parfrozen
Should each parameter be frozen. The default is that all parameters are thawed.

Notes

The parameters must be specified in the order that the function expects. That is, if the function has two parameters, pars[0]='slope' and pars[1]='y_intercept', then the call to add_user_pars must use the order ["slope", "y_intercept"].

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

December 2023