About
|
Holdings
|
Data Access
|
Help

IPAC ASCII Table File Formatting Help

This help page provides a guide to creating correctly formatted IPAC ASCII table files for use with the 2MASS Batch Image Service.

Table Header

Comment Lines

Only the initial lines in the table file can be comment lines. Comment lines must begin with a \ character, immediately followed by a space, and should have no more than 80 characters.

Here are the first two lines of a table file as an example:

\ this is a comment line,
\ and so is this
Header Lines
Column Name Line (Required)

This line contains field (column) names separated by bars (|). Column names

  • must begin with a letter ([a-z], [A-Z]) or the underscore character ( _ )
  • Can contain only alpha-numeric characters and underscores
    ([a-z], [A-Z], [0-9], _ )
  • cannot contain any whitespace characters
  • must be at most 16 characters long

Here are the first three lines of a table file as an example:

\ the first line following these comment
\ lines is the column name header line
|id   |ra     |dec    |size  |band|coadd_key |
Datatype Line (Optional)

If included, this line must immediately follow the column name line. It contains field (column) types separated by bars (|) which must be aligned with the bars in the column name line. Four different datatypes are supported:

  • r, re, rea, and real indicate that field values are 32 bit IEEE floating point numbers.
  • d, do, dou, doub, doubl, and double indicate that field values are 64 bit IEEE floating point numbers.
  • i, in, and int indicate that field values are 32 bit signed integer values.
  • c, ch, cha, and char indicate that field values are fixed length character strings. The string length equals the number of characters between the bars delimiting the field name (and datatype).

Here are the first four lines of a table file as an example:

\ the first line following these comment
\ lines is the column name header line
|id   |ra     |dec    |size  |band|coadd_key |
|char |double |double |real  |char|int       |

Note that every field in the column name line must have an entry in the datatype line and vice versa. Both header lines must have equal length, and every bar in one line must be matched to a bar in the other.

Required Columns

The 2MASS Batch Image Service requires input tables to contain certain columns (depending on the image retrieval mode utilized).

For a description of the various required column names and data formats, please see the 2MASS Batch Image Service Help webpage.

Table Rows (Data Lines)

Each line following the header line(s) corresponds to a single row in the table, and must contain a value for each column defined in the column name line.

Every data line (row) must have length equal to that of the header line(s). Furthermore, the characters comprising a field value must fall between the positions of the bars delimiting the field name and datatype in the header line(s).

Integer column values are assumed to be in the decimal form [-]dddd, where d is a numeric character ([0-9]).

Character column values are comprised of arbitrary ASCII character sequences, not including the newline and carriage return characters (since these are reserved to signal the start of a new row).

Floating point column values can be expressed in one of two decimal notations:

  • [-]ddd.ddd, where d is a numeric character ([0-9]). Examples are 99.075 and 0.033.
  • [-]d.ddde[+|-]dd, where d is a numeric character ([0-9]). Examples are 9.9075e+02 and 3.3e-02.

The following is a complete IPAC ASCII table, with comments shown in red, header lines in green, and data lines in purple. Whitespace is displayed in grey, delimiters in blue.

\.the.first.line.following.these.comment
\.lines.is.the.column.name.header.line
|id...|ra............|dec...........|size..|band|coadd_key.|
|char.|double........|double........|real..|char|int.......|
.....1.....218.793021......-9.988167.15.269....J....1590591.
.....2......13.889627.....-23.928709.16.954....H....1590591.
...-13.....319.026042.....-35.927643.16.413....J....1590590.
..5921......65.779078......87.000314..4.107....K.....699387.