|AHELP for CIAO 4.2||
Determine if a column exists in a crate.
- crate - input crate
- name - the column name to check
The col_exists command returns "1" if the column exists and "0" if not. The name comparison is case-insensitive. The crate must be a 'Table', 'ARF', 'PHA', or 'RMF' crate.
The print_col_names command ("ahelp print_col_names") lists all the columns in the file.
>>> cr = read_file("evt2.fits") >>> col_exists(cr, "ENERGY") 1 >>> col_exists(cr, "energy") 1
The keyword ENERGY exists in the file evt2.fits. Since the check is case-insensitive, the command returns 1 for both "ENERGY" and "energy".
>>> cr = read_file("evt2.fits") >>> col_exists(cr, "count_rate") 0
There is not a column named count_rate in the file evt2.fits.
See the bug pages on the CIAO website for an up-to-date listing of known bugs.