A model stack assigns an arbitrary name to a model
expression, for subsequent use in parameter expressions and/or
nested models.
sherpa> <model_stackname> = <modelExpr>
where <model_stackname> is the name being assigned to the model
expression.
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.
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).
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]}.
- sherpa
-
autoest,
background,
create,
create_model,
createparamset,
fit,
freeze,
get_defined_models,
get_model_params,
get_models,
get_num_par,
get_par,
get_stackexpr,
getx,
gety,
guess,
instrument,
integrate,
is_paramset,
jointmode,
kernel,
lineid,
linkparam,
mdl,
modelexpr,
nestedmodel,
noise,
paramprompt,
paramset,
pileup,
rename,
run_fit,
set_par,
set_paramset,
set_stackexpr,
source,
thaw,
truncate,
unlink
|