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

Synopsis

Module functions to get information about the quality of a fit.

Syntax

Array_Type get_fit([Integer_Type | Array_Type])
Array_Type get_goodness([Integer_Type | Array_Type])

Error Return Value: NULL

Arguments:

(1) data set number (default all data sets), or an array of data set
numbers.

Description

The functions get_fit() and get_goodness() return information about the quality of fit. Currently, the function returns an array of S-Lang variables of Struct_Type. The array is of length 1 if information for only one data set is requested, or N+1 if information for N data sets is requested. In the latter case, the total statistic, etc., is given by the first element of the returned array.

The output Struct_Type variable contains the following fields:

  • dataset: the number of the fit dataset; if NULL, then the Struct_Type variable contains information about all fits.
  • datatype: one of source, bkgd, or total.
  • stat: the observed statistic value, or the sum of the statistic values if datatype is set to total.
  • numbins: the number of bins involved in the fit.
  • dof: the number of degrees of freedom: numbins minus the number of model free parameters.
  • rstat: the reduced statistic, stat divided by dof; this field is NULL for the statistics CASH and BAYES.
  • qval: the q value (see get_qvalue()); this field is NULL for the statistics CASH and BAYES.

See the related Sherpa command GOODNESS for more information.

Example

[...fit two datasets...]
sherpa> res = get_fit()
sherpa> print(res[0])
dataset          =  NULL    # the total stat, etc., are shown
datatype         =  total   #
stat             =  127.821
numbins          =  200
dof              =  197
rstat            =  0.64884
qval             =  0.999964
sherpa> res = get_res(2)
sherpa> print(res[0])
dataset          =  2       # only the fit info for dataset 2 shown
datatype         =  source
stat             =  63.9103
numbins          =  100
dof              =  98
rstat            =  0.652146
qval             =  0.996969

CHANGES IN CIAO 3.2

The get_fit() function now works correctly when given an argument. Prior to CIAO 3.2 it would ignore the supplied argument.

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.