Chandra X-Ray Observatory (CXC)
Skip to the navigation links
Last modified: December 2012

URL: http://cxc.harvard.edu/ciao/key_exists.html
Jump to: Description · Example · Bugs · See Also


AHELP for CIAO 4.5

key_exists

Context: crates

Synopsis

Determine if the keyword exists in the crate.

Syntax

key_exists(crate, name)

Description

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

The key_exists command returns True if the keyword exists and False if not. The comparison is case-insensitive.

The get_key_names() routine ("ahelp get_key_names") can be used to find the names of all the keywords in a Crate.

Example

>>> cr = read_file("evt2.fits")
>>> key_exists(cr, "DETNAM")
True
>>> key_exists(cr, "detnam")
True

Note that the check is case-insensitive.

Bugs

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

Refer to the CIAO bug pages for an up-to-date listing of known issues.

See Also

contrib
add_keyval
crates
add_key, col_exists, cratekey, delete_key, get_key, get_key_names, get_keyval, is_pha, is_rmf, is_virtual, set_key, set_keyval

Last modified: December 2012
CXC logo

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-2012. All rights reserved.