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 2007

URL: http://cxc.harvard.edu/sherpabeta/fit.sl.html
AHELP for Sherpa 4.0 Beta fit Context: sl.sherpa

Synopsis

Perform a fit using current optimization method and fit statistic.

Syntax

fit( [ id=1, [otherids]] );

Description

The fit function fits the defined model(s) to the data. It may be called with no arguments, in which case a fit is done for the first data set. If one or more data set IDs are given, then a fit is performed for those data sets. If multiple data sets are indicated, then the fit is a simultaneous fit for all the indicated data sets.

The fit is done with the specified optimization method and statistic; the default values are levmar and chi2gehrels, respectively. The fit proceeds until it converges to within the set tolerance or hits the maximum number of iterations. The resulting best fit parameters and final statistic value are displayed to the user. The best-fit parameters are accessible with get_fit_results().

Example

sherpa> fit;
sherpa> fit(1);
sherpa> fit("src");
sherpa> fit(1,2);
sherpa> fit("src", "bkg");

The default is to fit on data set 1. A specific data set can be selected using its ID number or name. If multiple data sets are indicated, then the fit is a simultaneous fit for all the indicated data sets with the statistics value summed over all the data sets. Data set IDs can be integers or strings; in the latter case the string name may denote useful information about the data (e.g., whether it is your source or background data set).

Bugs

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

Last modified: December 2007



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.