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.html
Hardcopy (PDF): A4 | Letter
AHELP for CIAO 3.4 save Context: sherpa

Synopsis

Saves information to an ASCII file.

Syntax

sherpa> SAVE <arg> <filename>

Description

<arg> may be:

SAVE Command Arguments

Argument Description
ALL Equivalent to issuing the commands SAVE BACKGROUND, SAVE INSTRUMENT, SAVE METHOD, SAVE SYSTEM, SAVE SOURCE, and SAVE STATISTIC commands, in addition to saving the information needed to fully restore a Sherpa session, such as the names of the loaded datasets, and the currently defined filters.
SYSTEM Saves the parameter values and ranges for all current source, background, and instrument model components.
MODELS Saves current model component names (e.g., g for the definition GAUSS[g]).
<sherpa_model_stack> [# [ID]] Saves current names for all model components of the specified model stack (SOURCE, BACKGROUND, PILEUP, [B]NOISE, or KERNEL; also [B]INSTRUMENT) to their latest user-defined values. # is a dataset number (default 1); see BACKGROUND for an explanation of ID.
<model_stack> Saves current names for all model components of the specified user-defined model stack.
<sherpa_modelname> Saves the parameter values and ranges for the specified source, background, or instrument model component.
<modelname> Saves the parameter values and ranges for the specified source, background, or instrument model component.
METHOD Saves the current parameter values of the selected optimization method.
<sherpa_methodname> Saves the current parameter values of the specified optimization method.
STATISTIC Saves the name of the current statistic.

The SAVE command may be issued at any time. Each time the command is issued the specified ASCII file <filename> is written, saving the specified settings and values. If the specified ASCII file already exists, it will be overwritten.

Tip: the command SAVE ALL <filename> is useful for saving the current state of the user's Sherpa session; the current session may be restored at a later time by using <filename> as a Sherpa script.

Example 1

Write all settings, definitions, filters, and parameter values to an ASCII file:

sherpa> DATA data/example.pha
The inferred file type is PHA.  If this is not what you want, please
specify the type explicitly in the data command.
WARNING: using systematic errors specified in the PHA file.
RMF is being input from:
  <directory_path>/example.rmf
ARF is being input from:
  <directory_path>/example.arf
Background data are being input from:
  <directory_path>/example_bkg.pha
sherpa> LPLOT DATA
sherpa> IGNORE ALL
sherpa> NOTICE PLOT
sherpa> BBODY[modelh]
modelh.space parameter value [0] 
modelh.kT parameter value [0.592333] 
modelh.ampl parameter value [0.000464907] 
sherpa> SOURCE = modelh
sherpa> SAVE ALL mysession1.shp
sherpa> EXIT
Goodbye.

In this example, the ASCII file named mysession1.shp is written with: all program settings; all parameter values for the current method; all parameter values, including ranges and delta settings, for the current model components; source definitions for all datasets; and the name of the current statistic. Note that information about an interactively-specified filter is also included.

Example 2

Restore a session using the results of a previous SAVE ALL command:

sherpa> USE mysession1.shp

The command USE mysession1.shp restores the example session above, using the file mysession1.shp.

Example 3

Write all parameter values to an ASCII file:

sherpa> SAVE modelh mymodelh.shp
sherpa> $more mymodelh.shp
modelh integrate on
modelh.space.min = 0
modelh.space.max = 1
modelh.space.value = 0
modelh.space.type = freeze
modelh.kT.min = 0.00592333
modelh.kT.max = 59.2333
modelh.kT.value = 0.592333
modelh.kT.type = thaw
modelh.ampl.min = 4.64907e-06
modelh.ampl.max = 0.0464907
modelh.ampl.value = 0.000464907
modelh.ampl.type = thaw

In this example, the ASCII file named mymodelh.shp is written with the parameter values, including parameter ranges, for modelh.

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.