reset¶
-
sherpa.astro.ui.
reset
(model=None, id=None)¶ Reset the model parameters to their default settings.
The reset function restores the parameter values to the default value set by guess or to the user-defined default. If the user set initial model values or soft limits - e.g. either with set_par or by using parameter prompting via paramprompt - then reset will restore these values and limits even after guess or fit has been called.
Parameters: - model (optional) – The model component or expression to reset. The default is to use all source expressions.
- id (int or string, optional) – The data set to use. The default is to use all data sets with a source expression.
See also
fit()
- Fit one or more data sets.
guess()
- Set model parameters to values matching the data.
paramprompt()
- Control how parameter values are set.
set_par()
- Set the value, limits, or behavior of a model parameter.
Examples
The following examples assume that the source model has been set using:
>>> set_source(powlaw1d.pl * xsphabs.gal)
Fit the model and then reset the values of both components (
pl
andgal
):>>> fit() >>> reset()
Reset just the parameters of the
pl
model component:>>> reset(pl)
Reset all the components of the source expression for data set 2.
>>> reset(get_source(2))