astro py:docs

- Index
- Modules

### Navigation

- next »
- « previous |
- Astropy v1.1.1 »
- ASCII Tables (`astropy.io.ascii`) »
- FixedWidthHeader

# FixedWidthHeader

class `astropy.io.ascii.``FixedWidthHeader`

  Bases: `astropy.io.ascii.BasicHeader`

  Fixed width table header reader.

  Attributes Summary

  `position_line` | row index of line that specifies position (default = 1)
  `set_of_position_line_characters` |

  Methods Summary

  `get_cols`(lines) | Initialize the header Column objects from the table `lines`.
  `get_fixedwidth_params`(line) | Split `line` on 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` = set(['!', '`', '#', '"', '%', '$', "'", '&', ':', '+', '*', '-', '|', '^', '=', '\\', '_', '~'])

  Methods Documentation

  `get_cols`(lines)

    Initialize the header Column objects from the table `lines`.

    Based on the previously set Header attributes find or create the column names. Sets `self.cols` with the list of Columns.

    Parameters:

    lines : list

    > List of table lines

  `get_fixedwidth_params`(line)

    Split `line` on the delimiter and determine column values and column start and end positions. This might include null columns with zero length (e.g. for `header row = "| col1 || col2 | col3 |"` or `header2_row = "----- ------- -----"`). The null columns are stripped out. Returns the values between delimiters and the corresponding start and end positions.

    Parameters:

    line : str

    > Input line

    Returns:

    vals : list

    > List of values.

    starts : list

    > List of starting indices.

    ends : list

    > List of ending indices.

  `get_line`(lines, index)
  `write`(lines)