Skip to the navigation links
Last modified: December 2009

URL: http://cxc-newtest.cfa.harvard.edu/ciao4.2/add_key.sl.html
AHELP for CIAO 4.2

add_key

Context: sl.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 command returns a "1" if the keyword is successfully added.

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

slsh> cr = read_file("evt2.fits");
slsh> key = CrateKey();
slsh> key.name = "TIMEDEL";
slsh> key.load("0.00285");
slsh> key.unit = "s";
slsh> add_key(cr, key);
1

Create a new key named "TIMEDEL" with a value of 0.00285 and units of seconds, then add it to the crate.

Bugs

See the bug pages on the CIAO website for an up-to-date listing of known bugs.

See Also

sl.crates
add_col, add_piximg, delete_col, delete_key, delete_piximg, get_key, get_key_names, get_keyval, key_exists, print_key_names, read_arf, read_file, read_pha, read_rmf, set_keyval, write_arf, write_file, write_pha, write_rmf
sl.crates_contrib
make_table_crate, scale_image_crate, write_columns

Last modified: December 2009