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 2008

URL: http://cxc.harvard.edu/ciao4.1/crates.sl.html
AHELP for CIAO 4.1

crates

Context: sl.crates

Synopsis

CRATES - A high-level I/O interface for S-Lang

Description

CRATES is a software package developed by the Chandra X-Ray Center (CXC) to provide a high level I/O interface for use by S-Lang. The CIAO applications ChIPS and Sherpa use CRATES to read input data for use in plotting and fitting and to write output data files. It supports reading and writing both FITS and ASCII files.

The classes and methods allow a user to easily access and manipulate general data files. There are specialized classes for specific data products (e.g. PHA Type I and II, RMF, and ARF). CRATES also provides convenient access to metadata information, such as WCS transforms and Data Model (DM) subspace information which may be associated with a table column or image.

It can be used from S-Lang by saying

require ("crates");

The Sherpa and ChIPS environments automatically load CRATES at startup. There are help files for each of the CRATES commands; a full list can be seen with the following command

"ahelp -c sl.crates"

Example

slsh> require ("crates");
slsh> cr = read_file("src.pi");
slsh> r = copy_colvals(cr,"COUNT_RATE");
slsh> rmean = sum(r) / length(r);
slsh> print(rmean);
1.86376e-05

In this example, CRATES is used to load in the values of the COUNT_RATE column from the file "src.pi" into the crate "cr". The resulting array (r) is then used to calculate the mean value of the column.

Bugs

See the bug pages on the CIAO website for an up-to-date listing of known bugs.

Last modified: December 2008



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.