Convert `~astropy.table.Table` to `astropy.io.fits.BinTable`.

def _table_to_bintable(table):
    """Convert `~astropy.table.Table` to `astropy.io.fits.BinTable`."""
    data = table.as_array()
    header = fits.Header()
    header.update(table.meta)
    name = table.meta.pop('name', None)
    return fits.BinTableHDU(data, header, name=name)