FixedWidthHeader¶
-
class
astropy.io.ascii.FixedWidthHeader[source]¶ Bases:
astropy.io.ascii.BasicHeaderFixed width table header reader.
Attributes Summary
row index of line that specifies position (default = 1)
Methods Summary
get_cols(lines)Initialize the header Column objects from the table
lines.get_fixedwidth_params(line)Split
lineon the delimiter and determine column values and column start and end positions.get_line(lines, index)write(lines)Attributes Documentation
-
position_line= None¶ row index of line that specifies position (default = 1)
-
set_of_position_line_characters= {'!', '"', '#', '$', '%', '&', "'", '*', '+', '-', ':', '=', '\\', '^', '_', '`', '|', '~'}¶
Methods Documentation
-
get_cols(lines)[source]¶ Initialize the header Column objects from the table
lines.Based on the previously set Header attributes find or create the column names. Sets
self.colswith the list of Columns.- Parameters
- lineslist
List of table lines
-
get_fixedwidth_params(line)[source]¶ Split
lineon the delimiter and determine column values and column start and end positions. This might include null columns with zero length (e.g. forheader row = "| col1 || col2 | col3 |"orheader2_row = "----- ------- -----"). The null columns are stripped out. Returns the values between delimiters and the corresponding start and end positions.- Parameters
- linestr
Input line
- Returns
- valslist
List of values.
- startslist
List of starting indices.
- endslist
List of ending indices.
-