|
|
|
|
SynopsisIntroduction to Sherpa, the CIAO modeling and fitting package DescriptionThe CIAO 4 release includes a new, more powerful version of Sherpa, the CIAO modeling and fitting package. Sherpa enables the user to construct complex models from simple definitions and fit those models to data, using a variety of statistics and optimization methods. This document provides an introduction to Sherpa; more information is available on the website: http://cxc.harvard.edu/sherpa/ . Sherpa is designed for use in a variety of modes: as a user-interactive application and in batch mode. Sherpa is an importable module for scripting languages (Python or S-Lang) and is available as a C/C++ library for software developers. In addition, users may write their own Python and S-Lang scripts for use in Sherpa. The Sherpa session can be saved into a platform-independent state file. The session can then be restored at any time. Starting SherpaFrom the CIAO command line, type: unix% sherpa [-x|-b|-l|-n] <file> Any or all of the following options which may be supplied when Sherpa is started:
The startup script loads the Sherpa module, as well as the CRATES module, which handles file input and output ("ahelp crates"), and the Chips module, used for customizing the plots ("ahelp chips"). The language to use - S-Lang or Python - is determined by the hierarchy:
The "Starting Sherpa" thread has more details. The Sherpa Resource File: .sherpa.rcWhen Sherpa is started, it processes the $HOME/.sherpa.rc resource file. The resource file defines default behavior for the Sherpa commands and can be customized to the user's preferences; refer to "ahelp sherparc" for details. Loading Modules in PythonTo import the Sherpa, CRATES, and Chips modules in Python without using the "sherpa" startup script: from sherpa.astro.ui import * from pychips.hlui import * from pycrates import * Loading Modules in S-LangTo import the Sherpa, CRATES, and Chips modules in S-Lang without using the "sherpa" startup script:
require("sherpa");
require("chips_hlui");
require("crates");
Getting HelpThere are several ways to access the Sherpa help files. From the CIAO command line: o) Syntax, description and examples for a specific command: unix% ahelp <command> List of all Sherpa help files by context: unix% ahelp -c py.sherpa or unix% ahelp -c sl.sherpa From within Python or S-Lang, ahelp may be called two ways: o) Python:
sherpa> ahelp("<command>")
sherpa> !ahelp <command>
o) S-Lang:
sherpa> ahelp("<command>");
sherpa> !ahelp <command>;
The native help systems - called "help" in both cases - may also be used to obtain syntax information: # Python sherpa> help <command> # S-Lang sherpa> help <command>; CHANGES IN CIAO 4.1Startup OptionThe "-l" command-line option may be specified when ChIPS is started to select the language; see the text for details. BugsSee the bugs pages on the Sherpa website for an up-to-date listing of known bugs. |
![]() |
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. |