          Return a CrateData object of a column from a crate.

get_col(crate, colname)
get_col(crate, colnum)

Argument
Description
crate
The table crate.
colname
The column name (case insensitive).
colnum
The column number, where the first column is numbered 0.

The get_col command returns a CrateData object representing the the contents of the column within the crate. To retrieve just the column data (without any metadata), use copy_colvals or get_colvals.

The get_col_names routine can be used to find the columns in a Crate.

>>> cr = read_file("rprof.fits")
>>> col = get_col(cr, "sky")
>>> print(col)

The sky(x,y) column is retrieved from the crate "cr" as a CrateData object. The output of the print() call is a representation of the data stored in this object:

Name: sky Shape: (50, 2) Datatype: float64 Nsets: 50 Unit: pixel Desc: Position Eltype: Vector NumCpts: 2 Cpts: ['X', 'Y']

>>> cr = read_file("evt2.fits")
>>> col = get_col(cr, 0)
>>> print(col.name)
time
>>> print(col.unit)
s

Column number 0 - the time column in this file - is retrieved as a CrateData object.

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

December 2015