| AHELP for CIAO 4.5 Sherpa v1 | sherpa |
Context: sherpa |
Synopsis
Introduction to Sherpa, the CIAO modeling and fitting package
Description
The 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 Sherpa website.
Sherpa is designed for use in a variety of modes: as a user-interactive application and in batch mode. In CIAO 4.4, many plot modifications may be made via the ChIPS graphical user interface (GUI); more information is available in the "The ChIPS GUI" section below.
Sherpa is an importable module for the Python scripting language and is available as a C/C++ library for software developers. In addition, users may write their own Python 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 Sherpa
From the CIAO command line, type:
unix% sherpa [-x|-n|-b|-rcfile|-norcfile] <file>
Any or all of the following options which may be supplied when Sherpa is started:
- -x : launch Sherpa shell in separate display terminal.
- -n : prevents the Sherpa banner from being displayed on startup.
- -b : runs Sherpa in batch mode
- -rcfile : specify a specific .sherpa.rc file to use; refer to "ahelp sherparc" for details.
- -norcfile : do not load any .sherpa.rc file; overrides "-rcfile" if both are set.
- <file>: a file of Sherpa commands to run
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.
The Sherpa Resource File: .sherpa.rc
When 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
To 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 *
You may also find it useful to load the numpy module
import numpy as np
Getting Help
There are several ways to access the Sherpa help files.
From the CIAO command line
Syntax, description and examples for a specific command:
unix% ahelp <command>
Within Sherpa
Within the Sherpa application, ahelp or the native Python help system can be used:
sherpa> ahelp("<command>")
sherpa> ,ahelp <command>
sherpa> !ahelp <command>
sherpa> help <command>It is also possible to do a wildcard search:
sherpa> plot* ? sherpa> *psf ?
The ChIPS GUI
New in CIAO 4.4, a graphical user interface (GUI) to ChIPS allow users to adjust the layout of their plots and make edits to many of the plot properties. The GUI is available to any process that creates a ChIPS plot, such as Sherpa and Prism.
The GUI is launched by right clicking on an existing ChIPS window and selecting "Launch GUI" or by running the show_gui command from within a ChIPS session. A Python terminal is built into the GUI, allowing access to ChIPS and other Python commands.
Features include:
- the ability to edit the properties of an object, such as the symbol style of a curve or the font used for an axis label,
- zoom, pan, and select objects in the plot,
- update the plot ranges,
- move plot areas and annotations,
- resize plot areas, labels, and points,
- and an object tree which describes existing plot objects.
Futher information is available from the built-in help menu in the GUI and via "ahelp chipsgui".
Bugs
See the bugs pages on the Sherpa website for an up-to-date listing of known bugs.

![[Sherpa Logo]](../imgs/sherpa_logo_navbar.gif)