'Tests initializing a TableHDU with the data from a BinTableHDU.'

def test_bintable_to_asciitable(self):

    with fits.open(self.data('tb.fits')) as hdul:
        tbdata = hdul[1].data
        tbhdu = fits.TableHDU(data=tbdata)
        with ignore_warnings():
            tbhdu.writeto(self.temp('test.fits'), overwrite=True)
        with fits.open(self.temp('test.fits')) as hdul2:
            tbdata2 = hdul2[1].data
            assert np.all((tbdata['c1'] == tbdata2['c1']))
            assert np.all((tbdata['c2'] == tbdata2['c2']))
            assert np.all((tbdata['c3'].astype(np.float32) == tbdata2['c3'].astype(np.float32)))
            assert np.all((np.where(tbdata['c4'], 'T', 'F') == tbdata2['c4']))
