| 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

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