|
|
|
|
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 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 "Starting Sherpa" thread has more details, including how to select whether to use the S-Lang or Python language. 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) Python syntax, description and examples for a specific command: unix% ahelp py.sherpa <command> List of all Sherpa Python help files: unix% ahelp -c py.sherpa o) S-Lang syntax, description and examples for a specific command: unix% ahelp sl.sherpa <command> List of all Sherpa S-Lang help files: unix% ahelp -c sl.sherpa Users can create an alias for ahelp to default to one syntax. To always access Python syntax, for instance: unix% alias shelp "ahelp py.sherpa" unix% shelp notice From within Python or S-Lang, ahelp may be called two ways: o) Python:
sherpa> ahelp("<command>")
sherpa> !ahelp py.sherpa <command>
o) S-Lang:
sherpa> ahelp("<command>");
sherpa> !ahelp sl.sherpa <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>; BugsSee the bugs pages on the Sherpa Beta 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. |