Last modified: December 2013

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


AHELP for CIAO 4.16

key_exists

Context: crates

Synopsis

Determine if the keyword exists in the crate.

Syntax

key_exists(crate, keyname)

Description

Argument Description
crate A Crate object such as a TABLECrate or IMAGECrate
keyname The key name (case insensitive).

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

The get_key_names routine 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

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