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

Synopsis

Module functions to retrieve predicted model counts, statistics, residuals, sigma residuals, and ratios from source and background datasets.

Syntax

Array_Type get[_full]_[b]mcounts([Integer_Type])
Array_Type get[_full]_[b]statistics([Integer_Type])
Array_Type get[_full]_[b]residuals([Integer_Type])
Array_Type get[_full]_[b]delchi([Integer_Type])
Array_Type get[_full]_[b]ratio([Integer_Type])

Error Return Value: NULL

Arguments:

(1) data set number (default 1)

Description

The function get_mcounts() calls the model associated with the appropriate data set and returns an array containing the predicted model counts amplitudes (i.e., the y-values of the predicted data). The array contains only those y-values which fall within the filter. The other functions all return the result of a comparison of the predicted model counts amplitudes to the data set. Thus, get_statistics() returns an array of statistics (chi^2 only), get_residuals() returns residuals (D_i - M_i), get_delchi() returns residuals divided by sigma ((D_i - M_i) / sigma_i, where sigma_i is the estimated error), and get_ratio() returns ratios (D_i / M_i).

Arrays containing the whole, unfiltered sets of y-values are returned by using the related functions that have ``full'' added to their names. Thus, e.g., get_mcounts() returns the filtered array of predicted model counts, and get_full_mcounts() returns the unfiltered array of predicted model counts.

These functions all use the source model associated with the appropriate data set. (If no argument is given, the default is data set 1.) To instead use the background model and background data set associated with the data set number, append ``b'' to the function names, i.e., get_bmcounts() returns the filtered array of predicted model counts, for the background model, and get_full_bmcounts() returns the unfiltered array of predicted model counts, for the background model.

These quantities may be displayed, e.g., via the Sherpa plotting commands LPLOT [B]MCOUNTS, LPLOT [B]STATISTICS, LPLOT [B]RESIDUALS, LPLOT [B]DELCHI, and LPLOT [B]RATION.

Example

sherpa> data example.dat
sherpa> source = gauss
sherpa> foo = get_mcounts(1)
sherpa> printarr(foo,2)
0.162616
0.211218
sherpa> write models
Write X-Axis: Bin  Y-Axis: Flux (Counts)
        758     0.1626
        759     0.2112

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.