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/col_exists.sl.html
AHELP for CIAO 4.1

col_exists

Context: sl.crates

Synopsis

Determine if a column exists in a crate.

Syntax

col_exists(crate, name);

Description

  • crate - input crate
  • name - the column name to check

The col_exists command returns "1" if the column exists and "0" if not. The name comparison is case-insensitive. The crate must be a 'Table', 'ARF', 'PHA', or 'RMF' crate.

The print_col_names command ("ahelp print_col_names") lists all the columns in the file.

Example 1

slsh> cr = read_file("evt2.fits");
slsh> col_exists(cr, "ENERGY");
1
slsh> col_exists(cr, "energy");
1

The keyword ENERGY exists in the file evt2.fits. Since the check is case-insensitive, the command returns 1 for both "ENERGY" and "energy".

Example 2

slsh> cr = read_file("evt2.fits");
slsh> col_exists(cr, "count_rate");
0

There is not a column named count_rate in the file evt2.fits.

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.