BaseData#
- class astropy.io.ascii.BaseData[source]#
Bases:
object
Base table data reader.
Attributes Summary
Regular expression for comment lines
None, int, or a function of
lines
that returns None or intNone, int, or a function of
lines
that returns None or intMethods Summary
get_data_lines
(lines)READ: Set
data_lines
attribute to lines slice comprising table data values.Return a generator that returns a list of column values (as strings) for each data line.
masks
(cols)READ: Set fill value for each column and then apply that fill value.
process_lines
(lines)READ: Strip out comment lines and blank lines from list of
lines
.str_vals
()WRITE: convert all values in table to a list of lists of strings.
write
(lines)Write
self.cols
in place tolines
.Attributes Documentation
- comment = None#
Regular expression for comment lines
- end_line = None#
None, int, or a function of
lines
that returns None or int
- fill_exclude_names = None#
- fill_include_names = None#
- fill_values = [(<astropy.io.ascii.core.MaskedConstant object>, '')]#
- formats = {}#
- start_line = None#
None, int, or a function of
lines
that returns None or int
- write_spacer_lines = ['ASCII_TABLE_WRITE_SPACER_LINE']#
Methods Documentation
- get_data_lines(lines)[source]#
READ: Set
data_lines
attribute to lines slice comprising table data values.
- get_str_vals()[source]#
Return a generator that returns a list of column values (as strings) for each data line.
- masks(cols)[source]#
READ: Set fill value for each column and then apply that fill value.
In the first step it is evaluated with value from
fill_values
applies to which column usingfill_include_names
andfill_exclude_names
. In the second step all replacements are done for the appropriate columns.
- str_vals()[source]#
WRITE: convert all values in table to a list of lists of strings.
This sets the fill values and possibly column formats from the input formats={} keyword, then ends up calling table.pprint._pformat_col_iter() by a circuitous path. That function does the real work of formatting. Finally replace anything matching the fill_values.