About Chandra Archive Proposer Instruments & Calibration Newsletters Data Analysis HelpDesk Calibration Database NASA Archives & Centers Chandra Science Links

Skip the navigation links
Last modified: December 2008

URL: http://cxc.harvard.edu/ciao4.1/add_key.py.html
AHELP for CIAO 4.1

add_key

Context: py.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

>>> cr = read_file("evt2.fits")
>>> key = CrateKey()
>>> key.name = "TIMEDEL"
>>> key.load("0.00285")
>>> key.unit = "s"
>>> 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.

Last modified: December 2008



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-2004. All rights reserved.