Chandra X-Ray Observatory
Skip to the navigation links
Last modified: December 2015

Jump to: Description · Examples · Bugs · See Also

AHELP for CIAO 4.9


Context: crates


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.

Example 1

>>> 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']

Example 2

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

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.

Refer to the CIAO bug pages for an up-to-date listing of known issues.

See Also

add_col, add_piximg, col_exists, copy_colvals, copy_piximgvals, cratedata, create_vector_column, create_virtual_column, delete_col, get_axis_transform, get_col_names, get_colvals, get_crate_item_type, get_crate_type, get_key, get_key_names, get_keyval, get_number_cols, get_number_rows, get_piximg, get_piximg_shape, get_piximgvals, get_transform, get_transform_matrix, is_virtual, set_colvals

Last modified: December 2015
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: Smithsonian Institution, Copyright © 1998-2017. All rights reserved.