Skip to the navigation links
Last modified: December 2009

URL: http://cxc-newtest.cfa.harvard.edu/ciao4.2/print_col_names.py.html
AHELP for CIAO 4.2

print_col_names

Context: py.crates

Synopsis

Display the names of the columns in a crate.

Syntax

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

Description

  • crate - input 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 print_col_names command prints the names of the columns in the given crate. Allowed crate types are 'Table', 'ARF', 'PHA', and 'RMF'.

To retrieve the columns as an array, use the get_col_names command ("ahelp get_col_names").

Example 1

>>> cr = read_file("evt2.fits")
>>> print_col_names(cr)
Colname
0) time
1) ccd_id
2) node_id
3) expno
4) chip(chipx,chipy)
5) tdet(tdetx,tdety)
6) det(detx,dety)
7) sky(x,y)
8) pha
9) energy
10) pi
11) fltgrade
12) grade
13) status

Print the 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

>>> print_col_names(cr, vectors=False)
Colname
0) time
1) ccd_id
2) node_id
3) expno
4) chipx
5) chipy
6) tdetx
7) tdety
8) detx
9) dety
10) x
11) y
12) pha
13) energy
14) pi
15) fltgrade
16) grade
17) status

The column names are printed with the vector columns expanded (vectors=False).

Example 3

>>> print_col_names(cr, vectors=False, rawonly=False)
Colname
0) time
1) ccd_id
2) node_id
3) expno
4) chipx
5) chipy
6) tdetx
7) tdety
8) detx
9) dety
10) x
11) y
12) pha
13) pha_ro
14) energy
15) pi
16) fltgrade
17) grade
18) status
19) CPCX
20) CPCY
21) PHI
22) THETA
23) RA
24) DEC

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

Bugs

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

See Also

py.crates
add_col, col_exists, copy_colvals, cratedata, delete_col, get_col, get_col_names, get_colvals, get_number_cols, get_piximg, get_piximgvals, is_virtual, print_axis_names, print_key_names, set_colvals

Last modified: December 2009