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

Synopsis

Defines a model expression to be used for the background. The command BG is an abbreviated equivalent.

Syntax

sherpa> BACKGROUND [<dataset range> | ALLSETS [ID]] = <modelExpr>

<dataset range> = # (or more generally #:#,#:#, etc.) such that #
specifies a dataset number and #:# represents an inclusive range of
datasets; one may specify multiple inclusive ranges by separating them
with commas. The default dataset is dataset 1. The ID modifier is used
if and only if the Sherpa state object variable multiback is set to 1,
i.e., if more than one background dataset is to be associated with a
single source dataset. The ID modifier may be any unreserved string
(e.g., A, foo, etc.), i.e., a string that is not a parsable command.

Description

The model expression, <modelExpr>, is an algebraic combination of one or more of the following elements:

{<sherpa_modelname> | <sherpa_modelname>[modelname] | 
 <modelname> | <model_stack> | <nested_model>}

along with numerical values. The following operators are recognized: + - * / ( ) { }. See the CREATE command for further information.

Note that:

  • The documentation on Sherpa Models contains a summary list, and descriptions, of the models that are available within Sherpa, which include models from XSPEC, v. 11.3.
  • By default, if the model expression includes a model component that has not previously been established, Sherpa will prompt for the initial parameter values for that model component. This prompting can be turned off using the PARAMPROMPT OFF command.
  • In CIAO 3.1 the definition of INSTRUMENT BACK is required for both filtering and fitting of PHA data if either background file or background models have been defined. INSTRUMENT BACK is set automatically when the PHA source file is input to Sherpa, however it is deleted if the NEW background file is input for a given data set, thus the new INSTRUMENT BACK has to defined on the command line before filtering and fitting the data with the new background file.

To reset a background model stack, issue the command:

sherpa> BACKGROUND [<dataset range> | ALLSETS] =

How the background model stack is used depends upon whether or not the the source data have been background-subtracted:

  • If the source data are background-subtracted, then the background model stack is applied only to the fit of the background data themselves. The resulting statistic is added to that from the source model fit; changing a background model parameter has no effect on the source fit.
  • If the source data are not background-subtracted, then the background model stack is evaluated twice, once on a grid appropriate for the background data and a second time on a grid appropriate to the source data. To the latter array of amplitudes is added the evaluated source model amplitudes. Thus changing a background model parameter affects the fit statistic in both the background fit and the source fit!

Note on Model Normalization. Because the background is, by definition, an "extended object," the normalization of a best-fit background model will be affected by the size of the background extraction region, which is proportional to the area of the sky from which the photons came. In particular, if the areas of the source and background extraction regions differ, then the normalization may not be easily interpretable: which region does it correspond to? In CIAO 3.0, the rules are the following:

  • If source and background data have both been input, the best-fit background normalization corresponds to the source extraction region, with one exception noted below.
  • If background data only have been input, the best-fit background normalization corresponds to the background extraction region.
  • If source and background data have both been input, but the ratio of extraction "areas" differs as a function of energy (as it can for, e.g., XMM grating data), then the normalization corresponds to the pixel area equivalent to a BACKSCAL of one.

Example 1

Define a model to be used for the background and set background model parameter values:

sherpa> DATA 2 data.dat
sherpa> BACKGROUND 2 = GAUSS
GAUSS.fwhm parameter value [10]
GAUSS.pos parameter value [0] 3
GAUSS.ampl parameter value [1] 2:1:10

This command defines the Sherpa model GAUSS as the background model for dataset number 2. The user accepted the given initial guessed value for the parameter fwhm (using the <RETURN> key), entered a value of 3 for parameter pos, and entered a value of 2 (with min:max range of 1:10) for parameter ampl.

Example 2

Define a model to be used for the background and set the parameter values:

sherpa> PARAMPROMPT OFF
Model parameter prompting is off
sherpa> DATA data.dat
sherpa> POISSON[bkgA]
sherpa> BACKGROUND = bkgA

In the third command, the name bkgA is given to the Sherpa model component POISSON. The final command defines this model as the model to be used for the background.

Example 3

Create a background model expression:

sherpa> PARAMPROMPT ON
Model parameter prompting is on
sherpa> BACKGROUND = (POW[modelc])/2
modelc.gamma parameter value [0]
modelc.ref parameter value [1]
modelc.ampl parameter value [1]

This command assigns the model expression (POW[modelc])/2, to the background model for dataset number 1. In this example, the user accepted the given initial values for all of the parameters via parameter prompting.

See the SOURCE command documentation for more (analogous) examples.

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.