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/modelstack.html
Hardcopy (PDF): A4 | Letter
AHELP for CIAO 3.4 modelstack Context: sherpa

Synopsis

A model stack assigns an arbitrary name to a model expression, for subsequent use in parameter expressions and/or nested models.

Syntax

sherpa> <model_stackname> = <modelExpr>

where <model_stackname> is the name being assigned to the model
expression.

Example 1

Create a model stack for use in a parameter expression:

sherpa> ERASE ALL
sherpa> GAUSS[modelb]
sherpa> SRC = modelb
sherpa> PositionVariation = POLYNOM1D
sherpa> modelb.pos => PositionVariation

The command GAUSS[modelb], assigns the name modelb to the Sherpa model component GAUSS. The next command defines this model component as the source model to be used for fitting. The third command, PositionVariation = POLYNOM1D, assigns a model stack name to the Sherpa default model POLYNOM1D. The final command creates a parameter expression that links the parameter pos of modelb to the model component POLYNOM1D via the model stack name PositionVariation. Note that the creation of a model stack is necessary since the following syntax is currently not allowed: modelb.pos => POLYNOM1D.

Example 2

Create multiple model stacks for use in parameter expressions:

sherpa> ERASE ALL
sherpa> SRC = GAUSS[modelb]
sherpa> PositionVariation = POLY[modela]
sherpa> fwhmVariation = POLY[modelaa]
sherpa> modelb.pos => PositionVariation
sherpa> modelb.fwhm => fwhmVariation

This example creates two different model stacks, and assigns the names PositionVariation and fwhmVariation to the model stacks. These model stack names are then used in parameter expressions, to link different parameters of modelb to different model components: the command modelb.fwhm => fwhmVariation, for example, links the parameter fwhm of modelb to the model component modelaa (via the model stack name fwhmVariation).

Example 3

Create a model stack for use in a nested model:

sherpa> SHLOGE[modelk]
sherpa> independent = SIN[modeli] + COS[modelj]
sherpa> SOURCE = modelk{independent}

The command SHLOGE[modelk] assigns the name modelk to the Sherpa model component SHLOGE. Next, the user assigns a model stack name (independent) to the model expression SIN[modeli] + COS[modelj]}. With the final command, the user then assigns the model expression modelk{independent}, to the source model for dataset number 1. This source model expression is a nested model, which utilizes the model stack. Note that the model stack definition is necessary since the following syntax is not allowed: SOURCE = modelk{SIN[modeli] + COS[modelj]}.

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.