Table Of Contents

Previous topic

HDF5 tables

Next topic

ASCII tables

This Page

IPAC tables

Note

IPAC tables are an ASCII table that can contain a single table. The format can contain meta-data that consists of keyword values and comments (analogous to FITS files), and the column headers are separated by pipe (|) symbols that indicate the position of the columns.

IPAC tables are natively supported in ATpy (no additional module is required). Reading IPAC tables is straightforward:

>>> t = atpy.Table('table.tbl')

and writing a table out in IPAC format is equally easy:

>>> t.write('table.tbl')

IPAC tables can have three different definitions with regard to the alignment of the columns with the pipe symbols in the header. The definition to use is controlled by the definition argument. The definitions are:

  1. Any character below a pipe symbol belongs to the column on the left, and any characters below the first pipe symbol belong to the first column.
  2. Any character below a pipe symbol belongs to the column on the right.
  3. No characters should be present below the pipe symbols.

The default is definition=3.

Note

As for all file formats, the verbose argument can be specified to control whether warning messages are shown when reading (the default is verbose=True), and the overwrite argument can be used when writing to overwrite a file (the default is overwrite=False).

Full API for advanced users

Note

The following functions should not be called directly - the arguments should be passed to Table()/Table.read() and Table.write() respectively.

atpy.ipactable.read(self, filename, definition=3, verbose=False, smart_typing=False)

Read a table from a IPAC file

Required Arguments:

filename: [ string ]
The IPAC file to read the table from

Optional Keyword Arguments:

definition: [ 1 | 2 | 3 ]

The definition to use to read IPAC tables:

1: any character below a pipe symbol belongs to the
column on the left, and any characters below the first pipe symbol belong to the first column.
2: any character below a pipe symbol belongs to the
column on the right.
3: no characters should be present below the pipe
symbols (default).

smart_typing: [ True | False ]

Whether to try and save memory by using the smallest integer type that can contain a column. For example, a column containing only values between 0 and 255 can be stored as an unsigned 8-bit integer column. The default is false, so that all integer columns are stored as 64-bit integers.
atpy.ipactable.write(self, filename, overwrite=False)

Write the table to an IPAC file

Required Arguments:

filename: [ string ]
The IPAC file to write the table to