| AHELP for CIAO 4.4 | add_key |
Context: crates |
Synopsis
Add a keyword to a crate.
Syntax
add_key(crate, cratekey)
Description
- crate - input crate
- cratekey - CrateKey object to be added
The add_key command adds the keyword to the end of the keyword list in the crate. If the keyword already exists, the value is replaced.
The keyword is only added to the crate. The write_file ("ahelp write_file") command can be used to save the modified crate to a file.
Example
>>> cr = read_file("evt2.fits")
>>> key = CrateKey()
>>> key.name = "TIMEDEL"
>>> key.load("0.00285")
>>> key.unit = "s"
>>> add_key(cr, key)Create a new key named "TIMEDEL" with a value of 0.00285 and units of seconds, then add it to the crate.
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, make_image_crate, make_table_crate, scale_image_crate, smooth_image_crate, write_arrays, write_columns
- crates
- add_col, add_piximg, cratekey, delete_col, delete_key, delete_piximg, get_key, get_key_names, get_keyval, key_exists, read_file, read_pha, read_rmf, set_keyval, write_file, write_pha, write_rmf

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