def to_astropy_table(llwtable, apytable, copy=False, columns=None,<EOL>use_numpy_dtypes=False, rename=None):
<EOL>if rename is None:<EOL><INDENT>rename = {}<EOL><DEDENT>if columns is None:<EOL><INDENT>columns = llwtable.columnnames<EOL><DEDENT>data = []<EOL>for colname in columns:<EOL><INDENT>arr = _get_column(llwtable, colname)<EOL>copythis = isinstance(arr, numpy.ndarray)<EOL>data.append(to_astropy_column(arr, apytable.Column, copy=copythis,<EOL>use_numpy_dtype=use_numpy_dtypes,<EOL>name=rename.get(colname, colname)))<EOL><DEDENT>return apytable(data, copy=False, meta={'<STR_LIT>': str(llwtable.Name)})<EOL>
Convert a :class:`~ligo.lw.table.Table` to an `~astropy.tableTable`

    This method is designed as an internal method to be attached to
    :class:`~ligo.lw.table.Table` objects as `__astropy_table__`.

    Parameters
    ----------
    llwtable : :class:`~ligo.lw.table.Table`
        the LIGO_LW table to convert from

    apytable : `type`
        `astropy.table.Table` class or subclass

    copy : `bool`, optional
        if `True` copy the input data, otherwise return a reference,
        default: `False`

    columns : `list` of `str`, optional
        the columns to populate, if not given, all columns present in the
        table are mapped

    use_map_dtypes : `bool`, optional
        force column `dtypes

    rename : `dict`, optional
        dict of ('old name', 'new name') pairs to rename columns
        from the original LIGO_LW table

    Returns
    -------
    table : `EventTable`
        a view of the original data