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

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


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

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.