Skip to the navigation links
Last modified: December 2009

URL: http://cxc-newtest.cfa.harvard.edu/ciao4.2/crates.sl.html
AHELP for CIAO 4.2

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.

See Also

sl.crates
add_col, add_key, add_piximg, col_exists, copy_colvals, copy_piximgvals, cratedata, delete_col, delete_key, delete_piximg, get_axis_transform, get_col, get_col_names, get_colvals, get_crate_item_type, get_crate_type, get_key, get_key_names, get_keyval, get_number_cols, get_number_rows, get_piximg, get_piximg_shape, get_piximgvals, get_transform, get_transform_matrix, is_arf, is_pha, is_rmf, is_virtual, key_exists, print_axis_names, print_col_names, print_key_names, read_arf, read_file, read_pha, read_rmf, set_colvals, set_keyval, set_piximgvals, write_arf, write_file, write_pha, write_rmf
sl.crates_contrib
make_table_crate, scale_image_crate, write_columns

Last modified: December 2009