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

URL: http://cxc.harvard.edu/ciao/set_keyval.html
AHELP for CIAO 4.4

set_keyval

Context: crates

Synopsis

Set the keyword value in a crate.

Syntax

set_keyval(crate, keyname, value)
set_keyval(crate, keynum, value)

Description

  • crate - input crate
  • keyname - key name (case insensitive)
  • keynum - key number, where the first key is numbered 0
  • value - new value for the key

The set_keyval command sets the value of an existing keyword within the input crate. Use the add_key routine to create a new keyword.

The value is only changed in the crate; the input file is unaffected. The write_file command ("ahelp write_file") can be used to save the modified crate to a file.

Example

>>> cr = read_file("evt2.fits")
>>> set_keyval(cr, "ORIGIN", "CXC")
>>> write_file(cr, "evt2.fits", clobber=True)

Update the value of the ORIGIN keyword to "CXC", then overwrite the original file.

Changes in CIAO 4.4

The routine no longer returns a value (1) to indicate it was succesfull.

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, cratekey, delete_key, get_key, get_key_names, get_keyval, key_exists, set_colvals, set_piximgvals

Last modified: December 2011
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.