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

URL: http://cxc.harvard.edu/ciao/get_col_names.html
Jump to: Description · Examples · Bugs · See Also


AHELP for CIAO 4.5

get_col_names

Context: crates

Synopsis

Return an array of the column names in a crate.

Syntax

get_col_names(crate, [vectors=True], [rawonly=True])

Description

  • crate - input table crate
  • vectors - flag to control format for vector columns: True (default) shows vector notation, False displays the individual component columns
  • rawonly - flag for including or excluding virtual columns: True (default) excludes virtual columns, False includes them

The get_col_names command returns an array of strings containing the names of the columns in the table crate.

Example 1

>>> cr = read_file("evt2.fits")
>>> cnames = get_col_names(cr)
>>> print(cnames)
['time' 'ccd_id' 'node_id' 'expno' 'chip(chipx,chipy)'
'tdet(tdetx,tdety)' 'det(detx,dety)' 'sky(x,y)'
'pha' 'energy' 'pi' 'fltgrade' 'grade' 'status']

Get the array of column names from the crate "cr". The default settings are used, so the output includes regular column names and vector column names in vector notation, but not virtual column names.

Example 2

>>> cnames = get_col_names(cr, vectors=False, rawonly=False)
>>> print(cnames)
['time' 'ccd_id' 'node_id' 'expno' 'chipx' 'chipy' 'tdetx' 'tdety'
'detx'
'dety' 'x' 'y' 'pha' 'pha_ro' 'energy' 'pi' 'fltgrade' 'grade' 'status'
'CPCX' 'CPCY' 'PHI' 'THETA' 'RA' 'DEC']

The column names are retrieved with the vector columns expanded (vectors=False) and virtual columns are included (rawonly=False).

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
add_colvals
crates
add_col, col_exists, copy_colvals, copy_piximgvals, delete_col, get_axis_transform, get_col, 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 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.