paramprompt¶
-
sherpa.astro.ui.paramprompt(val=False)¶ Should the user be asked for the parameter values when creating a model?
When val is
True, calls to set_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 are- return 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, andmaxcomponents 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
Trueonly makes sense in an interactive environment. It is designed to be similar to the parameter prompting provided by X-Spec [1].References
[1] https://heasarc.gsfc.nasa.gov/xanadu/xspec/ Examples
In the following, the default parameter settings are accepted for the
pl.gammaparameter, the starting values for thepl.refandgline.posvalues are changed, the starting value and ranges of both thepl.amplandgline.amplparameters are set, and thegline.fwhmparameter 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