Skip to the navigation links
Last modified: December 2009

AHELP for CIAO 4.2


Context: sl.crates


Return an array of the column names in a crate.


get_col_names(crate; [vectors=1], [rawonly=1]);


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

The get_col_names command returns an array of strings containing the names of the columns in the crate. Allowed crate types are 'Table', 'ARF', 'PHA', and 'RMF'.

Example 1

slsh> cr = read_file("evt2.fits");
slsh> cnames = get_col_names(cr);
slsh> 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

slsh> cnames = get_col_names(cr; vectors=0, rawonly=0);
slsh> print(cnames);
['time' 'ccd_id' 'node_id' 'expno' 'chipx' 'chipy' 'tdetx' 'tdety'
'dety' 'x' 'y' 'pha' 'pha_ro' 'energy' 'pi' 'fltgrade' 'grade' 'status'

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


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

See Also

add_col, col_exists, copy_colvals, cratedata, 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, print_col_names, set_colvals

Last modified: December 2009