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/save_state.html
Hardcopy (PDF): A4 | Letter
Jump to: Description Bugs


AHELP for CIAO 3.4 save_state Context: sherpa

Synopsis

The save_state() function

Description

Sherpa has many state objects; several that control the appearance of plots (e.g., sherpa.plot) and several that control the execution of parameter estimation methods (e.g., sherpa.regproj). A user could spend much time changing the default values of the state objects to more closely match theor preferences. The function save_state() provides an easy way to save the current values of all the fields of all the state objects to a file, which can then be read into Sherpa at a later time. For example:

sherpa> save_state()
sherpa> save_state("state1.shp")

In the former case, the values of the state objects are saved to the file $HOME/.sherpa-state-rc (which is overwritten every time save_state() is executed). If $HOME/.sherpa-state-rc exists, then the file is automatically read in whenever the user starts Sherpa. In the latter case, the state is saved in the file state1.shp; this file will not be automatically read in. The user can read in the file at any time during the Sherpa session. This can be useful if, for example, the user wishes to use two or more different plot styles.

At the beginning of a Sherpa session, Sherpa looks for a .sherpa-state-rc in the following locations:

  • the $SHERPA_STATE_RC environment variable
  • $PWD/.sherpa-state-rc
  • $HOME/.sherpa-state-rc

The search stops when the first match is made and Sherpa is launched, even if the chosen .sherpa-state-rc file contains an error. Sherpa first searches for a .sherpa-state-rc, and if it is found, reads it in; then Sherpa searches for a .sherparc file, and if a .sherparc file is found, reads it in. Thus, .sherparc can contain configuration variable settings that can override settings in .sherpa-state-rc, as .sherparc is read in after the .sherpa-state-rc file.

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.