About Chandra Archive Proposer Instruments & Calibration Newsletters Data Analysis HelpDesk Calibration Database NASA Archives & Centers Chandra Science Links

Skip the navigation links
Last modified: 3 November 2009

URL: http://cxc.harvard.edu/sherpa4.1/sherpacl/index.html

SherpaCL - the CIAO 3.4-style command-line interface to Sherpa and ChIPS

[New] (3 nov 2009) The November 2009 release of the CIAO contributed scripts and modules package includes the experimental sherpacl application, which

  1. provides users with an interactive environment which supports a subset of the Sherpa and ChIPS command languages from CIAO 3.4,

  2. converts the CIAO 3.4 commands into their CIAO 4 versions (where possible).

This application is provided with limited support and testing; please check your results carefully.

If you have questions about, or problems with, the SherpaCL application then please submit them to us via the CXC Helpdesk.

The following information is available:

  1. Starting SherpaCL
  2. Getting help within SherpaCL
  3. Using SherpaCL to convert to CIAO 4 syntax
  4. Functionality and Limitations
  5. Future development

Starting SherpaCL

First check that the latest version of the CIAO contributed scripts file is installed: if the date is earlier than shown below then follow the installation instructions to get the latest version.

unix% cat $ASCDS_CONTRIB/VERSION.CIAO_scripts 
03 Nov 2009

The application can then be started using the name sherpacl, and help is available using ahelp sherpacl. After displaying a banner, a prompt is displayed at which commands can be entered:

unix% sherpacl

-------------------------------------------------------
Welcome to SherpaCL: CXC's Modeling and Fitting Program
-------------------------------------------------------
Version: 0.1 - October 2009

Type AHELP for help.
Type SYNTAX command for the syntax of the command.
Type EXIT, QUIT, or BYE to leave the program.

 Solar Abundance Vector set to angr:  Anders E. & Grevesse N. Geochimica et Cosmochimica Acta 53, 197 (1989)
 Cross Section Table set to bcmc:  Balucinska-Church and McCammon, 1998

sherpacl> data src.pi
=> Loading dataset 1 from src.pi
read ARF file src.arf
read RMF file src.rmf
read background file bgnd.pi
sherpacl> subtract
sherpacl> notice energy 0.5:6
sherpacl> source = xsphabs[gal] * xsmekal[clus]
gal.nh parameter value [1.0] 
clus.kt parameter value [1.0] 
clus.nh parameter value [1.0] 
clus.abundanc parameter value [1.0] 
clus.redshift parameter value [0.0] 
clus.switch parameter value [1.0] 
clus.norm parameter value [0.73388922635] 
sherpacl> show source
Expression: (gal * clus)

xsphabs.gal  (integrate: on)
   Param        Type          Value          Min          Max      Units
   -----        ----          -----          ---          ---      -----
   gal.nh       thawed      1.00607            0       100000 10^22 atoms / cm^2
xsmekal.clus  (integrate: on)
   Param        Type          Value          Min          Max      Units
   -----        ----          -----          ---          ---      -----
   clus.kt      thawed      0.98284       0.0808         79.9        keV
   clus.nh      frozen            1        1e-05        1e+19       cm-3
   clus.abundanc frozen            1            0         1000           
   clus.redshift frozen            0            0           10           
   clus.switch  frozen            1            0            1           
   clus.norm    thawed  0.000733889  0.000733889      733.889           
sherpacl> ahelp lp
...
sherpacl> lp fit
sherpacl> log
sherpacl> fit
...

Getting help within SherpaCL

The application provides the AHELP command, which accesses its own help documentation. You can use:

AHELP

Provides information on the AHELP command and documentation provided within SherpaCL. To access the standard CIAO4 ahelp you need to say "!ahelp <text>" (i.e. call the CIAO 4 ahelp command as a normal UNIX program).

SYNTAX <command>

Displays the SYNTAX block from the ahelp file for the command, if it exists. This is new to SherpaCl.

AHELP <command>

Displays the help file for the command or term, if it exists.

AHELP COMMANDS

Displays a list of the Sherpa and ChIPS commands that SherpaCL supports.

AHELP UNSUPPORTED

Displays a list of the Sherpa and ChIPS commands and concepts that SherpaCL does not support.

AHELP SHERPA

Describes the level of support for the CIAO 3.4 command languages of ChIPS and Sherpa.

AHELP SHERPACL

Describes how to start sherpacl, including command-line flags and options. It is the same information as provided in ahelp sherpacl at the UNIX prompt.


Using SherpaCL to convert to CIAO 4 syntax

The CONVERT command is used to display the CIAO 4 version of any supported CIAO 3.4 command:

sherpacl> paramprompt off
Model parameter prompting is off
sherpacl> convert on
Convert setting is on, output to screen
sherpacl> source = xsphabs[gal] * xsmekal[src]
-> set_source(xsphabs.gal*xsmekal.src)
sherpacl> notice energy 0.5:6
-> notice_id(1,0.5,6.0)
sherpacl> 

The default is to print the converted commands to the screen, but they can also be sent to a file. So, to convert the contents of fit.shp to fit.py you would say

sherpacl> !cat fit.shp
#
# A simple test of Sherpa capabilities
#

data ../data/src.pi
subtract

notice energy 0.5:6
source = xsphabs[gal] * xsmekal[clus]
thaw clus.abundanc

fit
lplot fit
log
covar

sherpacl> convert to fit.py
Convert setting is on, output to fit.py
sherpacl> use fit.shp
...
sherpacl> convert off
Convert setting is off
sherpacl> !cat fit.py
#  USE: Inserting contents of fit.shp
# 
#  A simple test of Sherpa capabilities
# 
load_data("../data/src.pi")
subtract()
notice_id(1,0.5,6.0)
set_source(xsphabs.gal*xsmekal.clus)
thaw(clus.abundanc)
fit()
plot_fit()
log_scale()
covar()

Functionality and Limitations

Simple analysis sessions of PHA, ASCII, and image files are possible in SherpaCL. There is limited support for defining and using complicated instrument models, or for long-running sessions in which many datasets, models, and instrument models are created and then destroyed or over-written.

Syntax

In general the syntax is the same, but some changes have been made; mostly new capabailites have been added to commands - such as the "BY" option of the GROUP command - but some options or text that was valid in CIAO 3.4 will not be recognized by SherpaCL.

Commands

There are a number of Sherpa commands, and most ChIPS commands, that are not currently supported. Some of these may be supported in a later release, although not all functionality from CIAO 3.4 can be supported in CIAO 4.

S-Lang

There is limited support for using S-Lang within SherpaCL. S-Lang statements can be used, but many of the Sherpa and ChIPS S-Lang routines - such as get_par, run_fit, and curve - are not available in this release of SherpaCL.


Future development

The SherpaCL application is provided as an aid for Sherpa and ChIPS users who wish to use CIAO 4 but have too many scripts for CIAO 3.4, or do not have the time to learn the new syntax.

At present it has limited capabilites; if you find it useful and would like to see SherpaCL enhanced please contact the CXC Helpdesk.

Last modified: 3 November 2009


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.