| AHELP for CIAO 4.5 | get_key |
Context: crates |
Synopsis
Return a CrateKey object of a keyword from a crate.
Syntax
get_key(crate, keyname) get_key(crate, keynum)
Description
- crate - input crate
- keyname - key name (case insensitive)
- keynum - key number, where the first key is numbered 0
The get_key command returns a CrateKey object representing the given keyword within the crate. To retrieve just the keyword value (without any metadata), use get_keyval ("ahelp get_keyval").
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")
>>> datekey = get_key(cr, "DATE")
>>> print(datekey)The output is:
Name: DATE Value: 2011-11-15T15:51:27 Unit: Desc: Date and time of file creation
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, set_key
- crates
- add_key, copy_piximgvals, cratekey, delete_key, get_axis_transform, get_col, get_col_names, get_colvals, get_crate_item_type, get_crate_type, get_key_names, get_keyval, get_number_cols, get_number_rows, get_piximg, get_piximg_shape, get_piximgvals, get_transform, get_transform_matrix, key_exists, set_keyval

![[CIAO Logo]](../imgs/ciao_logo_navbar.gif)