Basic

class astropy.io.ascii.basic.Basic [edit on github][source]

Bases: astropy.io.ascii.core.BaseReader

Read a character-delimited table with a single header line at the top followed by data lines to the end of the table. Lines beginning with # as the first non-whitespace character are comments. This reader is highly configurable.

rdr = ascii.get_reader(Reader=ascii.Basic)
rdr.header.splitter.delimiter = ' '
rdr.data.splitter.delimiter = ' '
rdr.header.start_line = 0
rdr.data.start_line = 1
rdr.data.end_line = None
rdr.header.comment = r'\s*#'
rdr.data.comment = r'\s*#'

Example table:

# Column definition is the first uncommented line
# Default delimiter is the space character.
apples oranges pears

# Data starts after the header column definition, blank lines ignored
1 2 3
4 5 6

Page Contents