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

Synopsis

Module function to fit datasets, and retrieve information about the final fit.

Syntax

Struct_Type run_fit([{Integer_Type | Array_Type}])

Arguments:

(1) Dataset number or array of dataset numbers (default all datasets)

Description

This function initiates a Sherpa fit. When complete, it calls get_goodness, and a structure or an array of structures is returned. A single structure is returned if only one data set is fit, and an array of N+1 structures is returned if N data sets are fit simultaneously. For the latter case, the summed statistics for the combined fit are returned in the 0th element of the structure array.

See the related Sherpa commands FIT and GOODNESS for more information.

Example

Load two datasets; fit the second and examine the results:

sherpa> DATA 1 example.pha
The inferred file type is PHA.  If this is not what you want, please 
specify the type explicitly in the data command.
WARNING: using systematic errors specified in the PHA file.
RMF is being input from:
  <directory_path>/example2.rmf
ARF is being input from:
  <directory_path>/example2.arf
Background data are being input from:
  <directory_path>/example2_bkg.pha
sherpa> DATA 2 spec.dat
sherpa> () = set_source_expr(2,"CONST[cs]")
sherpa> result = run_fit(2)
 LVMQT: V2.0
 LVMQT: initial statistic value = 82.2297
 LVMQT: final statistic value = 63.9111 at iteration 3
            cs.c0  57.7977     

sherpa> print(result)
dataset          =  2
datatype         =  source
stat             =  63.9111
numbins          =  100
dof              =  99
rstat            =  0.645567
qval             =  0.997605

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.