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

Skip the navigation links
Last modified: 11 December 2007

URL: http://cxc.harvard.edu/ciao3.4/download/scripts/instructions.html
Hardcopy (PDF): A4 | Letter

Installing and Using Scripts



Installation

All of the contributed scripts are contained in the CIAO_scripts.tar package. The scripts page describes the scripts available for download. Some scripts consist of a single file, while others include supporting files, such as a parameter file and a help file. The installation process is described step-by-step in the README_CIAO_scripts file.

As explained in the README, the scripts are intended to be installed in the $ASCDS_INSTALL/contrib directory of the CIAO directory structure. If you do not maintain your own CIAO installation, you will have to ask your system administrator to install the package.

Installing the scripts in this way provides seamless integration with CIAO: Command-line scripts will be in the user's path, S-Lang scripts and functions will be within S-Lang's search path, and, for scripts that provide XML documentation (e.g. a help file) and a parameter file, ahelp and the parameter interface will function as they do for official CIAO tools.

Uninstalling Old Scripts

Note: this step is required if you have upgraded from a version lower than CIAO 3.0.2.

Before installing the a new script package, you should remove the files from previous script installations. Since the directory structure changed with CIAO 3.0.2, the uninstall script you need depends on how old your installation is:

Please see the text of the individual uninstall scripts for usage instructions and some warnings about the uninstallation process.


Running a Script

There are two general types of scripts: command-line scripts (written for the slsh, sh, ksh, and Perl interpreters) and S-Lang scripts, which are run from within a S-Lang-enabled application (such as ChIPS or Sherpa).

Command-Line Scripts

When CIAO is started, the contributed script directory is added to the user's path (in this example, $ASCDS_INSTALL is set to /soft/ciao/):

unix% echo $PATH
...:/soft/ciao/contrib/bin:/soft/ciao/contrib:/soft/ciao/bin:...

This makes it possible to call the script from the command line just like a CIAO tool, without needing to specify the path:

unix% merge_all
Input event file(s) (): 
...

Note that the scripts are executable by default when they are installed, so there should not be any need to change permissions (e.g. "chmod +x merge_all") before use.

S-Lang Scripts

S-Lang scripts must be used from within ChIPS, Sherpa, or an slsh script. This example is taken from the Filtering Lightcurves thread:

chips> () = evalfile("analyze_ltcrv.sl")
chips> analyze_ltcrv("lc_c7.fits")

As explained in README_CIAO_scripts, CIAO can automatically find S-Lang scripts that are installed in $ASCDS_INSTALL/contrib/share/slsh/local-packages, so it isn't necessary to specify the path.

See the S-Lang tips help file for more information on running S-Lang scripts.

Hardcopy (PDF): A4 | Letter
Last modified: 11 December 2007


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.