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 2008

URL: http://cxc.harvard.edu/sherpa4.1/fake_pha.sl.html
AHELP for Sherpa 4.1

fake_pha

Context: sl.sherpa

Synopsis

Simulate a PHA dataset with faked counts using Poisson noise

Syntax

fake_pha( id; arf, rmf, exposure, [backscal=NULL, areascal=NULL,
grouping=NULL, grouped=1, quality=NULL, bkg=NULL] );

Description

The fake_pha command creates a PHA dataset with faked counts given a source model and a grid (e.g. ARF and RMF). The generated counts will contain Poisson noise.

Before fake_pha can be run, a model with the same id as the faked dataset must be defined; see "ahelp set_model"

  • id - id for the faked dataset. Any existing id will be overwritten, so use different values to compare results from more than one simulation or to compare a simulation to real data.
  • arf - ARF data
  • rmf - RMF data
  • exposure - length of observation in seconds
  • backscal - background scaling factor; default=NULL
  • areascal - area scaling factor; default=NULL
  • grouping - integer array of grouping flags; default=NULL
  • grouped - boolean to indicate if data is grouped; default=1
  • quality - integer array of quality flags; default=NULL
  • bkg - PHA data for the background; default=NULL

If a source data set by data set ID is used and contains no grouping flags then 'grouped' should be negated.

Example 1

sherpa> fake_pha(1; arf=get_arf, rmf=get_rmf, exposure=50000);

Using the ARF and RMF associated with dataset 1 - obtained via the get_arf and get_rmf commands - simulate a 50ks dataset. The faked data overwrites the existing dataset with id=1.

Example 2

sherpa> set_model("faked",const1d.c1*powlaw1d.p1);
sherpa> fake_pha("faked"; arf=get_arf(), rmf=get_rmf(), exposure=10000,
grouped=0, bkg=get_bkg());

A model is defined for the dataset id "faked", then fake_pha is run to simulate an ungrouped 10ks dataset.

Example 3

sherpa> rmf = unpack_rmf("3c273.rmf");
sherpa> set_model(xsphabs.abs1*powlaw1d.p1);
sherpa> fake_pha(1; arf=NULL, rmf=rmf, exposure=10000, grouped=0);

A 10ks dataset is faked with just an RMF (no ARF).

Bugs

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

Last modified: December 2008



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.