Last modified: December 2024

URL: https://cxc.cfa.harvard.edu/sherpa/ahelp/get_model_pars.html
AHELP for CIAO 4.17 Sherpa

get_model_pars

Context: modeling

Synopsis

Return the names of the parameters of a model.

Syntax

get_model_pars(model)

Description


Examples

Example 1

>>> mdl = gauss2d.src + const2d.bgnd
>>> get_model_pars(mdl)
['fwhm', 'xpos', 'ypos', 'ellip', 'theta', 'ampl', 'c0']

Example 2

The return value is unchanged if the two models are linked together, such as setting the background amplitude to 1% of the source amplitude:

>>> bgnd.c0 = 0.01 * src.ampl
>>> get_model_pars(mdl)
['fwhm', 'xpos', 'ypos', 'ellip', 'theta', 'ampl', 'c0']

Example 3

If a model expression contains linked parameters that are not part of the model expression then they will also be included (in this case both the const2d and scale1d parameters are named 'c0', hence the duplication):

>>> scale1d.sep
<Scale1D model instance 'scale1d.sep'>
>>> src.ypos = src.xpos + sep.c0
>>> get_model_pars(mdl)
['fwhm', 'xpos', 'ypos', 'ellip', 'theta', 'ampl', 'c0', 'c0']

PARAMETERS

The parameter for this function is:

Parameter Type information
model str or a sherpa.models.model.Model object

Return value

The return value from this function is:

names -- The names of the parameters in the model expression. These names do not include the name of the parent component.

Changes in CIAO

Added in CIAO 4.17

Linked components are now included without having to include them in the model expression.


Bugs

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

See Also

modeling
get_model, get_model_type, get_source