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

URL: http://cxc.harvard.edu/ciao/add_keyval.html
AHELP for CIAO 4.5

add_keyval

Context: contrib

Synopsis

Add a keyword to a crate given a name and a value *DEPRECATED*

Syntax

Please use the following routine from Crates:
set_key(crate, keyname, keyval, unit=None, desc=None)

add_keyval(crate, keyname, keyval, unit=None, desc=None)

Description

Deprecated

This routine is deprecatde; please use the set_key() routine from Crates instead.

Adds a key to the header of the crate; existing keywords are replaced. If the unit argument is not None then it is a string listing the units of the key. If desc is not None then it is used as the description of the key.

Loading the routine

The routine can be loaded into a ChIPS or Sherpa session by saying:

from crates_contrib.utils import *

Example

chips> cr = make_table_crate(x, y, z, colnames=["x", "y", "z"])
chips> set_key(cr, 'xmean', x.mean())
chips> set_key(cr, 'zmax', z.mean(), unit='cm**2', desc='Max of Z')

Here we add the XMEAN and ZMAX keywords to a crate, the first with the mean of the x array and the second with the maximumn value of the z column. The ZMAX keyword has its units and description set as well.

Changes in the December 2012 Release

This routine is deprecated; please use set_key() from Crates instead.

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

crates
add_key, cratekey, delete_key, get_key, get_key_names, get_keyval, key_exists, set_key, set_keyval

Last modified: November 2012
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.