@with_read_hdf5<EOL>def table_from_file(source, ifo=None, columns=None, selection=None,<EOL>loudest=False, extended_metadata=True):
<EOL>if isinstance(source, h5py.File):<EOL><INDENT>source, ifo = _find_table_group(source, ifo=ifo)<EOL><DEDENT>if columns is None:<EOL><INDENT>columns = list(_get_columns(source))<EOL><DEDENT>readcols = set(columns)<EOL>selection = parse_column_filters(selection or [])<EOL>if selection:<EOL><INDENT>readcols.update(list(zip(*selection))[<NUM_LIT:0>])<EOL><DEDENT>meta = {'<STR_LIT>': ifo}<EOL>meta.update(source.attrs)<EOL>if extended_metadata:<EOL><INDENT>meta.update(_get_extended_metadata(source))<EOL><DEDENT>if loudest:<EOL><INDENT>loudidx = source['<STR_LIT>'][:]<EOL><DEDENT>data = []<EOL>for name in readcols:<EOL><INDENT>try:<EOL><INDENT>arr = source[name][:]<EOL><DEDENT>except KeyError:<EOL><INDENT>if name in GET_COLUMN:<EOL><INDENT>arr = GET_COLUMN[name](source)<EOL><DEDENT>else:<EOL><INDENT>raise<EOL><DEDENT><DEDENT>if loudest:<EOL><INDENT>arr = arr[loudidx]<EOL><DEDENT>data.append(Table.Column(arr, name=name))<EOL><DEDENT>return filter_table(Table(data, meta=meta), selection)[columns]<EOL>
Read a `Table` from a PyCBC live HDF5 file

    Parameters
    ----------
    source : `str`, `h5py.File`, `h5py.Group`
        the file path of open `h5py` object from which to read the data

    ifo : `str`, optional
        the interferometer prefix (e.g. ``'G1'``) to read; this is required
        if reading from a file path or `h5py.File` and the containing file
        stores data for multiple interferometers

    columns : `list` or `str`, optional
        the list of column names to read, defaults to all in group

    loudest : `bool`, optional
        read only those events marked as 'loudest',
        default: `False` (read all)

    extended_metadata : `bool`, optional
        record non-column datasets found in the H5 group (e.g. ``'psd'``)
        in the ``meta`` dict, default: `True`

    Returns
    -------
    table : `~gwpy.table.EventTable`