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

URL: http://cxc.harvard.edu/ciao/ahelp/add_colvals.html
Jump to: Description · Example · Bugs · See Also


AHELP for CIAO 4.9

add_colvals

Context: contrib

Synopsis

Add a column to a crate given a name and array of values

Syntax

add_colvals(crate, colname, colvals, unit=None, desc=None)

Description

Adds a column with a name of colname and contents of colvals - which should be an array - to the table crate. If the unit argument is not None then it is a string listing the units of the column. If desc is not None then it is used as the description of the column.

Loading the routine

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

from crates_contrib.utils import *

Example

chips> cr = read_file('table.dat')
chips> c = get_colvals(cr, 'counts')
chips> t = get_colvals(cr, 'exposure')
chips> add_colvals(cr, 'rate', c/t, unit='s**-1')
chips> write_file(cr, 'table.dat', clobber=True)

Here we add the column "rate", defined as counts/exposure, to the table and then overwrite the original file.

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
make_table_crate, write_columns
crates
add_col, col_exists, copy_colvals, delete_col, get_col, get_col_names, get_colvals, get_number_cols, is_virtual, set_colvals

Last modified: December 2013
Smithsonian Institute Smithsonian Institute

The Chandra X-Ray Center (CXC) is operated for NASA by the Smithsonian Astrophysical Observatory. 60 Garden Street, Cambridge, MA 02138 USA.   Email:   cxchelp@head.cfa.harvard.edu Smithsonian Institution, Copyright © 1998-2017. All rights reserved.