paramprompt
- sherpa.astro.ui.paramprompt(val=False)
Should the user be asked for the parameter values when creating a model?
When
val
isTrue
, calls toset_model
will cause the user to be prompted for each parameter in the expression. The prompt includes the parameter name and default value, in[]
: the valid responses arereturn which accepts the default
value which changes the parameter value
value, min which changes the value and the minimum value
value, min, max which changes the value, minimum, and maximum values
The
value
,min
, andmax
components are optional, so “,-5” will use the default parameter value and set its minimum to -5, while “2,,10” will change the parameter value to 2 and its maximum to 10, but leave the minimum at its default. If any value is invalid then the parameter is re-prompted.- Parameters
val (bool, optional) – If
True
, the user will be prompted to enter each parameter value, including support for changing the minimum and maximum values, when a model component is created. The default isFalse
.
See also
set_model
Set the source model expression for a data set.
set_par
Set the value, limits, or behavior of a model parameter.
show_model
Display the model expression used to fit a data set.
Notes
Setting this to
True
only makes sense in an interactive environment. It is designed to be similar to the parameter prompting provided by XSPEC.Examples
In the following, the default parameter settings are accepted for the
pl.gamma
parameter, the starting values for thepl.ref
andgline.pos
values are changed, the starting value and ranges of both thepl.ampl
andgline.ampl
parameters are set, and thegline.fwhm
parameter is set to 100, with its maximum changed to 10000.>>> paramprompt(True) >>> set_source(powlaw1d.pl + gauss1d.gline) pl.gamma parameter value [1] pl.ref parameter value [1] 4500 pl.ampl parameter value [1] 1.0e-5,1.0e-8,0.01 gline.fwhm parameter value [10] 100,,10000 gline.pos parameter value [0] 4900 gline.ampl parameter value [1] 1.0e-3,1.0e-7,1