Skip to the navigation links
Last modified: 19 January 2010

URL: http://cxc.harvard.edu/ciao4.2/download/scripts/instructions.html

Installing and Using Scripts



Installation

All of the contributed scripts are contained in the CIAO contributed tarfile. The scripts page describes the scripts available for download. All of the script have a help file ("ahelp <scriptname>"); some scripts also have a parameter 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: the scripts will be available via the appropriate paths and ahelp and the parameter interface will work as they do with the CIAO tools.


Running a Script

There are three general types of scripts: command-line scripts (written for the slsh, sh, ksh, and Perl interpreters), S-Lang scripts, and Python scripts.

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-4.2/bin:/soft/ciao-4.2/contrib/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 called from within an interpreter, such ChIPS, Sherpa, or slsh:

chips> require ("lightcurves");
chips> lc_sigma_clip("lc_c7.fits");

CIAO defines the $SLANG_SCRIPT_PATH environment variable, which includes the path to the scripts directory ($ASCDS_INSTALL/contrib/share/slsh/local-packages). Therefore, it isn't necessary to specify the path in the require command.

Python Scripts

Python scripts must be called from within an interpreter, such as ChIPS, Sherpa, or IPython:

chips> from lightcurves import *
chips> lc_sigma_clip("lc_c7.fits")

CIAO defines the $PYTHONPATH environment variable, which includes the path to the scripts directory ($ASCDS_INSTALL/contrib/lib/python2.6/site-packages). Therefore, it isn't necessary to specify the path in the import command.


Last modified: 19 January 2010