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

Synopsis

Erases user inputs and settings, and/or model components.

Syntax

sherpa> ERASE [{ALL | <sherpa_modelname> | <modelname> |
<model_stack> | DATA [#] | BACK [# [ID]]}]

where # specifies the number of the dataset to be erased (default
dataset number is 1). The ID modifier is used if and only if the Sherpa
state object variable multiback is set to 1, i.e., if more than one
background dataset is to be associated with a single source dataset.
The ID modifier may be any unreserved string (e.g., A, foo, etc.),
i.e., a string that is not a parsable command.

Description

ERASE ALL causes the following to be erased from the current Sherpa session:

  • All source and background datasets.
  • All defined model components and model stacks.

Note that ERASE ALL does not cause the optimization method, statistic choice, parameter prompting, or variables within the state object to be reset to default values. RESET is a related command that may be used to restore program settings and parameter values.

ERASE <sherpa_modelname> and ERASE <modelname> cause the specified single model component to be erased. Note, however, that a single component cannot be erased if it is part of a model stack definition (e.g., SOURCE). Clear the stack first (by issuing, e.g., the command SOURCE =), then issue the ERASE command.

ERASE <model_stack> causes the specified single user-defined model stack to be removed; like above, it cannot be erased if it is part of another stack's definition.

Example 1

Remove a model component:

sherpa> DATA example.dat
sherpa> PARAMPROMPT OFF
Model parameter prompting is off
sherpa> POW[modelc]
sherpa> SHOW
Current Data Files:
Data 1: data/example.dat ascii 1 2.
Total Size: 4 bins (or pixels)
Dimensions: 1
Total counts (or values): 31

Optimization Method: Powell

Statistic: Chi-Squared Gehrels

Current Models are:

Current Composite Models are:

Current Model Components are:
powlaw1d[modelc]  (integrate: on)
    Param   Type      Value        Min        Max                 Units
    -----   ----      -----        ---        ---                 -----
 1  gamma thawed          1        -10         10
 2    ref frozen          1          1          4
 3   ampl thawed          3     0.0300        300
sherpa> ERASE modelc

In this example, a dataset is input and a model component called modelc is established. The ERASE command then removes this model component.

Example 2

Erase a background dataset:

sherpa> DATA example2.pha
...
Background data are being input from:
  <directory path>/example2_bkg.pha
sherpa> SHOW
...
-----------------
Input data files:
-----------------

Data 1: example2.pha pha.
...

  Background 1: <directory path>/example2_bkg.pha pha.
...
sherpa> ERASE BACK
sherpa> SHOW
...
-----------------
Input data files:
-----------------

Data 1: example2.pha pha.
...
sherpa>

In this example, the background dataset was automatically loaded into Sherpa because the source dataset PHA file contained the header keyword BACKFILE.

Example 3

Remove all user inputs and user-defined settings:

sherpa> METHOD GRID
sherpa> STATISTIC BAYES
sherpa> ERASE ALL
sherpa> SHOW
Current Data Files:

Optimization Method: Grid

Statistic: Bayes

Current Models are:

Current Composite Models are:

Current Model Components are:

This example illustrates that ERASE ALL does not return either the optimization method or the statistic to the default setting (the default method is LEVENBERG-MARQUARDT; the default statistic is CHI GEHRELS).

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.