Last modified: December 2024

URL: https://cxc.cfa.harvard.edu/sherpa/ahelp/set_par.html
Jump to: · Examples · PARAMETERS · Notes · Bugs · See Also


AHELP for CIAO 4.17 Sherpa

set_par

Context: modeling

Synopsis

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

Syntax

set_par(par, val=None, min=None, max=None, frozen=None)

Examples

Example 1

Change the parameter value to 23.

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

Example 2

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 Type information Definition
par str The name of the parameter, using the format "componentname.parametername".
val number, optional Change the current value of the parameter.
min number, optional Change the minimum value of the parameter (the soft limit).
max number, optional Change the maximum value of the parameter (the soft limit).
frozen bool, optional 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

Bugs

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

See Also

confidence
set_conf_opt, set_covar_opt, set_proj_opt
contrib
renorm
data
set_areascal, set_arf, set_backscal, set_bkg, set_coord, set_counts, set_data, set_dep, set_exposure, set_grouping, set_quality, set_rmf, set_staterror, set_syserror
filtering
set_filter
methods
set_iter_method, set_iter_method_opt, set_method, set_method_opt
modeling
freeze, get_par, guess, link, paramprompt, set_bkg_model, set_bkg_source, set_full_model, set_model, set_pileup_model, set_source, thaw, unlink
statistics
set_prior, set_sampler, set_sampler_opt, set_stat
utilities
set_analysis, set_default_id
visualization
image_setregion