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 2007

URL: http://cxc.harvard.edu/ciao4.0/col_exists.py.html
AHELP for CIAO 4.0 col_exists Context: py.crates

Synopsis

Does the column exist in the crate?

Syntax

col_exists(crate, name)

Description

  • crate - input Crate object
  • name - the column name to check for

Returns 1 if the column exists within the input Crate, 0 if not. The name comparison is case-sensitive. The crate must be a 'Table', 'ARF', 'PHA', or 'RMF' crate.

Argument Description
crate a Crate object
name the column name

Example

>>> crate = read_file("table.fits")
>>> print_col_names(crate)
Index Colname
0) CHANNEL
1) E_MIN
2) E_MAX
>>> col_exists(crate, "CHANNEL")
1
>>> col_exists(crate, "channel")
0
>>>

Check if the column named "CHANNEL" exists in the file table.fits.

Bugs

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

Last modified: 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.