          Return an array of the column names in a crate.

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

Argument
Description
crate
A Crate object such as a TABLECrate or IMAGECrate
vectors
Should vector notation be used (True) or should individual component columns be included (False)?
rawonly
Should virtual columns be excluded (True) or included (False)?

The get_col_names command returns an array of strings containing the names of the columns in the table crate. The format of these column names depends on the vectors and rawonly arguments.

>>> 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.

>>> 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).

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

December 2014