[AstroPy] AstroPy Digest, Vol 151, Issue 3
Derek Homeier
derek at astro.physik.uni-goettingen.de
Wed Apr 17 19:13:53 EDT 2019
On 17 Apr 2019, at 8:32 pm, Ivan Valtchanov <ivvv68 at gmail.com> wrote:
>
> You cannot use BinTableHDU to create an astropy.tableTable object. When you try to do this you get this error:
>
> table = Table(hdu[1])
>
> Data type <class 'astropy.io.fits.hdu.table.BinTableHDU'> not allowed to init Table
>
> But this one works,
>
> table = Table(hdu[1].data)
>
> although I don't think it's documented in astropy.table docs. I could not find it easily.
>
Actually you can pass the BinTableHDU object to the read() function instead of a file,
which will properly handle the rest (including filling the table.meta information), and
that’s probably what Christoph referred to:
table = Table.read(hdu[1])
But it certainly looks like a peculiar egg; Happy Easter!
Derek
More information about the AstroPy
mailing list