About Chandra Archive Proposer Instruments & Calibration Newsletters Data Analysis HelpDesk Calibration Database NASA Archives & Centers Chandra Science Links

Skip the navigation links
Last modified: December 2006

URL: http://cxc.harvard.edu/ciao3.4/create.html
Hardcopy (PDF): A4 | Letter
AHELP for CIAO 3.4 create Context: sherpa

Synopsis

Establishes a model component and its parameters, for use in the current Sherpa session.

Syntax

sherpa> [CREATE] <sherpa_modelname>

(The brackets around CREATE indicate that its use is optional; see
examples below.) In addition, Sherpa provides the user with the ability
to both establish a model component, and to assign to it an arbitrary
name:

sherpa> [CREATE] <sherpa_modelname>[<modelname>]

where <sherpa_modelname>is the Sherpa default model name (or an XSPEC
model name, with the prefix `xs' attached), and <modelname> is the name
being given to the model component by the user. Note that <modelname>
must be enclosed in brackets, [ ].

Description

Sherpa's ability to assign arbitrary names to model components allows the user to establish multiple independent models of the same type during a single session, and is a valuable feature of the software. Note that an assigned model name can be any arbitrary string, except a string that is already a Sherpa command.

By default, Sherpa will prompt the user for the initial model component parameter values. (Parameter prompting can be turned off using the command PARAPROMPT OFF.) At the model parameter prompt, the user may either:

  • Hit the <RETURN> key to accept the given initial parameter value. Note that if a dataset has not been input, then the initial parameter values are arbitrary default values. However, if a dataset has been input, then the initial parameter values are estimates based on the filtered data and the defined instrument model (see AUTOESTfor more information).
  • Hit the <RETURN> key to accept the given initial parameter value, and subsequently set the parameter value and range using one of the syntax options whose descriptions may be found in PARAMSET (see CREATEPARAMSET).
  • Hit the <RETURN> to accept the given initial parameter value, and subsequently set the parameter value using the GETX or GETY command, which allows the user to assign the value interactively from a plot.
  • Enter ,-1 to accept the given initial parameter value, and to set the parameter to be frozen. Note that there cannot be a space between the , and the -1.
  • Enter <value>:<min>:<max>[:<delta>][,-1], where:

Argument Description
<value> Model parameter initial value.
<min> Minimum value for that parameter range.
<max> Maximum value for that parameter range.
<delta> Specifies initial parameter step size.
,-1 Sets the parameter to be frozen.

Note that the default setting for delta is 1% of the parameter value. Otherwise, specifying delta will set the initial parameter step size to an absolute value. The parameter step size is used by the optimization method to determine where to sample parameter space. As such, if the value of a parameter is known well, then specifying a small delta may lead to a substantially faster and better fit.

Note that this colon separated list need not include all of the elements, but it does need to maintain the proper sequential order, and also include the colons around skipped elements. Also, there cannot be a space between the , and the -1.

The model components that have been established in the current Sherpa session, and their parameter information, may be listed with the command SHOW MODELS. Note however that information about model parameter delta settings is currently not returned by SHOW. Information about model parameter delta settings is included when using SAVE.

For more information on: Type:
Setting parameter values and ranges ahelp paramset, ahelp createparamset
Linking parameter values ahelp linkparam
Freezing and thawing model parameters ahelp freeze, ahelp thaw
How parameter value estimates are made ahelp autoest, ahelp guess
Controlling model integration ahelp integrate
Creating model expressions ahelp modelexpr
Creating model stacks ahelp modelstack
Creating nested models ahelp nestedmodels
Creating joint-mode models ahelp jointmode

Example 1

Establish a model component

sherpa> CREATE POLY
POLY.c0 parameter value [1]
POLY.c1 parameter value [0]
POLY.c2 parameter value [0]
POLY.c3 parameter value [0]
POLY.c4 parameter value [0]
POLY.c5 parameter value [0]
POLY.c6 parameter value [0]
POLY.c7 parameter value [0]
POLY.c8 parameter value [0]
POLY.offset parameter value [0]

The command CREATE POLY establishes the Sherpa modelPOLY as a model component available for use in the current Sherpa session. Note that after issuing this command, the user is prompted for the initial model parameter values. In this example, the user accepted the given initial values for all of the parameters, using the <RETURN> key. The following command is equivalent:

sherpa> POLY

Example 2

Establish a model component, and assign it a name:

sherpa> CREATE POLY[modela]
modela.c0 parameter value [1]
modela.c1 parameter value [0]
modela.c2 parameter value [0]
modela.c3 parameter value [0]
modela.c4 parameter value [0]
modela.c5 parameter value [0]
modela.c6 parameter value [0]
modela.c7 parameter value [0]
modela.c8 parameter value [0]
modela.offset parameter value [0]

The command CREATE POLY[modela] establishes the Sherpa model component POLY, and assigns to it the name modela. Note that after issuing this command, the user is prompted for the initial model parameter values. In this example, the user accepted the given initial values for all of the parameters, using the <RETURN> key. The following command is equivalent:

sherpa> POLY[modela]

Example 3

Establish a model component, assign it a name, set parameter values and ranges including initial parameter step size, and freeze a parameter:

sherpa> GAUSS[modelb]
modelb.fwhm parameter value [10] 2.0:1:10:0.5
modelb.pos parameter value [0] 1:0.1:
modelb.ampl parameter value [1] 3::100:2,-1

This example establishes and assigns the name modelb to the Sherpa model component GAUSS1D. Note that in this example the user entered an initial value of 2.0, a minimum range value of 1, a maximum range value of 10, and an initial parameter step size delta of 0.5 for parameter fwhm; entered a value of 1, and a minimum range value of 0.1 for parameter pos; and entered a value of 3, a maximum range value of 100, and an initial parameter step size of 2 for parameter ampl, and froze this parameter.

Example 4

Establish a model component, assign it a name, set parameter values and ranges, and freeze a parameter:

sherpa> GAUSS[modelbb]
modelbb.fwhm parameter value [10] 2.0:1:10
modelbb.pos parameter value [0] 1:0.1:
modelbb.ampl parameter value [1] 3::100,-1

This example establishes and assigns the name modelb to the Sherpa model component GAUSS1D. Note that in this example the user entered an initial value of 2.0, a minimum range value of 1, and a maximum range value of 10 for parameter fwhm; entered a value of 1, and a minimum range value of 0.1 for parameter pos; and entered a value of 3, and a maximum range value of 100 for parameter ampl, and froze this parameter (note that after the maximum range value, specification of initial parameter step size delta is optional and may be omitted).

Example 5

Establish an XSPEC model component, assign it a name, and freeze a parameter:

sherpa> XSBBODY[modeld]
modeld.kT parameter value [3]
modeld.norm parameter value [1] ,-1

This command establishes and assigns the name modeld to the XSPEC model component bbody. In this example, the user accepted the given initial values for all of the parameters, using the <RETURN>, and set parameter norm to be frozen.

Example 6

Turn off model parameter prompting; establish a model component and assign it a name:

sherpa> PARAMPROMPT OFF
Model parameter prompting is off
sherpa> POW[modelc]

The first command turns off prompting for model parameter values. The second command establishes the Sherpa model component POW, and assigns to it the name modelc. Since parameter prompting was turned off, the model is automatically established using the given initial values for all of the parameters.

Example 7

Establish two independent model components of the same type:

sherpa> ERASE ALL
sherpa> PARAMPROMPT ON
Model parameter prompting is on
sherpa> POW[modelc]
modelc.gamma parameter value [0] 1.0
modelc.ref parameter value [1]
modelc.ampl parameter value [1]
sherpa> POW[modelc2]
modelc2.gamma parameter value [0] 2.0
modelc2.ref parameter value [1]
modelc2.ampl parameter value [1]

The third command establishes the Sherpa model component POWLAW1d, and assigns to it the name modelc. In this example, the user set parameter gamma of model component modelc to the value of 1.0. The last command establishes another Sherpa model component POWLAW1d, and assigns to it the name modelc2. In this example, the user set parameter gamma of model component modelc2 to the value of 2.0. Note that model components modelc and modelc2 are independent of one another.

Bugs

See the Sherpa bug pages online for an up-to-date listing of known bugs.

Hardcopy (PDF): A4 | Letter
Last modified: December 2006



The Chandra X-Ray Center (CXC) is operated for NASA by the Smithsonian Astrophysical Observatory.
60 Garden Street, Cambridge, MA 02138 USA.    Email: cxcweb@head.cfa.harvard.edu
Smithsonian Institution, Copyright © 1998-2004. All rights reserved.