Last modified: December 2019

URL: https://cxc.cfa.harvard.edu/ciao/ahelp/print_crate_names.html
Jump to: Description · Examples · Bugs


AHELP for CIAO 4.16

print_crate_names

Context: crates

Synopsis

Display information on data from a crate.

Syntax

print_axis_names(crate)
print_col_names(crate, vectors=True, rawonly=True)
print_key_names(crate)

Description

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

These routines return a string which describes the contents of the Crate. They are intended for exploratory analysis and simple debugging; other routines exist to access this information in a more programmatic manner.

The print_axis_names command prints the names of the axes in the given IMAGECrate.

The print_col_names command prints the names of the columns in the given table crate. To retrieve the columns as an array, use the get_col_names command, which should be used instead of print_col_names() if possible.

The print_key_names command prints the names of the keywords in the given crate. To retrieve the keywords as an array, use the get_key_names command, which should be used instead of print_key_names() if possible.


Examples

Example 1

>>> cr = read_file("image.fits")
>>> print(print_axis_names(cr))
 Index  Axisname
   0)   sky
   1)   EQPOS

Example 2

>>> cr = read_file("evt2.fits")
>>> print(print_col_names(cr))

The output of the above is:

        Colname
   0)   sky(X, Y)
   1)   EQPOS(RA, Dec)
   2)   SHAPE
   3)   R
   4)   ROTANG
   5)   COMPONENT
   6)   COUNTS
   7)   ERR_COUNTS
   8)   AREA
   9)   EXPOSURE
  10)   COUNT_RATE
  11)   COUNT_RATE_ERR
  12)   NET_COUNTS
  13)   NET_ERR
  14)   NET_RATE
  15)   ERR_RATE
  16)   SUR_BRI
  17)   SUR_BRI_ERR

As the default settings are used, the output includes regular column names and vector column names in vector notation, but not virtual column names.

Example 3

>>> print(print_col_names(cr, vectors=False))

The output changes to:

        Colname
   0)   X
   1)   Y
   2)   RA
   3)   Dec
   4)   SHAPE
   5)   R
   6)   ROTANG
   7)   COMPONENT
   8)   COUNTS
   9)   ERR_COUNTS
  10)   AREA
  11)   EXPOSURE
  12)   COUNT_RATE
  13)   COUNT_RATE_ERR
  14)   NET_COUNTS
  15)   NET_ERR
  16)   NET_RATE
  17)   ERR_RATE
  18)   SUR_BRI
  19)   SUR_BRI_ERR

Example 4

>>> print(print_col_names(cr, vectors=False, rawonly=False))
        Colname
   0)   X
   1)   Y
   2)   RA
   3)   Dec
   4)   SHAPE
   5)   R
   6)   ROTANG
   7)   COMPONENT
   8)   COUNTS
   9)   ERR_COUNTS
  10)   AREA
  11)   EXPOSURE
  12)   COUNT_RATE
  13)   COUNT_RATE_ERR
  14)   NET_COUNTS
  15)   NET_ERR
  16)   NET_RATE
  17)   ERR_RATE
  18)   SUR_BRI
  19)   SUR_BRI_ERR
  20)   CEL_R
  21)   CEL_AREA
  22)   CEL_BRI
  23)   CEL_BRI_ERR

Example 5

>>> print(print_key_names(cr))
 Index  Keyname
   0)   ASOLFILE
   1)   THRFILE
   2)   ORIGIN
   3)   CREATOR
   4)   ASCDSVER
   5)   MJD_OBS
   6)   DS_IDENT
...

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.