|AHELP for CIAO 4.2||
Set the keyword value in a crate.
set_keyval(crate, keyid, value)
- crate - input crate
- keyid - keyword name or number, where the first keyword is numbered 0
- value - input key value
The set_keyval command sets the value of an existing keyword within the input crate. The command returns a "1" if the keyword is successfully added.
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.
>>> cr = read_file("evt2.fits") >>> set_keyval(cr, "ORIGIN", "CXC") 1 >>> write_file(cr, "evt2.fits") 1
Update the value of the ORIGIN keyword to "CXC", then overwrite the original file.
See the bug pages on the CIAO website for an up-to-date listing of known bugs.