readfile.header
Creates a list of strings containing the selected-column names from an ASCII
file. Mostly useful by calling readfile.dict
.
> head = readfile.header(file, *optional_args)
file
type:
string
parameter:
Name of the file. File should be a table with objects of arbitrary
type (same per column). If cols
is specified, the file can have incomplete
columns (that are not included in the columns to be read).
cols
type:
int or list of ints
default:
'all'
parameter:
Column(s) to be returned. Numbering starts at 0
.
mode
type:
{'1', '2'}
default:
'1'
parameter:
mode '1' means column names are given in the first line,
separated by spaces; mode '2' means they are given in separate lines at the top of
the file with column numbers, as in SExtractor outputs. Note that the latter headers
usually enumerate the columns starting from 1, which is corrected here.
removechar
type:
string
default:
'#'
parameter:
Character to be removed from the beginning of the header, which
should be defined in the first line with column names separated by delimiter
.
This is useful because usually the header stars with a special character so that it is
not included in the table, but this character is not a column name.