          Return the value of a keyword in a crate.

get_keyval(crate, keyname)
get_keyval(crate, keynum)

Argument
Description
crate
A Crate object such as a TABLECrate or IMAGECrate
keyname
The key name (case insensitive).
keynum
The number of the key, where the first key is numbered 0.

The get_keyval command returns the value of specified keyword within the crate.

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

The get_key command returns a CrateKey object for the keyword, which is useful if you are interested in the metadata associated with it.

>>> cr = read_file("evt2.fits")
>>> print(get_keyval(cr, "EXPOSURE"))
18792.5851136

The value of the EXPOSURE keyword is retrieved with get_keyval.

>>> expo = get_keyval(cr, "EXPOSURE")
>>> print(expo)
18792.5851136

The value of the EXPOSURE keyword is stored in the variable "expo".

>>> print(get_keyval(cr, 9))
2001-07-09T22:31:32

The value of keyword number 9 - the DATE keyword in this file - is returned.

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

December 2013