[AstroPy] fits type of bintable extension

Thomas Robitaille thomas.robitaille@gmail....
Wed Mar 13 13:11:26 CDT 2013


Hi Paul,

It isn't a feature or bug, it's more just to do with the fact that the
pyfits package is now in astropy.io.fits, so the path to the classes
has changed. As Alex pointed out, you can use isinstance(), but note
that you can use pyfits.BinTableHDU and astropy.io.fits.BinTableHDU
for conciseness (you don't need the .hdu.table. part) since the
classes are imported into the top level of pyfits and astropy.io.fits.

FYI, If you want to use Astropy instead of PyFITS with minimal changes
to scripts, you can do:

from astropy.io import fits as pyfits

and the rest of the script will not need to be modified.

Cheers,
Tom


On 13 March 2013 18:25, Paul Kuin <npkuin@gmail.com> wrote:
> Hi,
>
> Just looking at the type of one of my bintable extensions and see that it is
> astropy.io.fits.hdu.table.BinTableHDU
>
> I was thinking that this makes is a little more difficult to test the
> type between the
> pyfits and astropy.io.fits packages.
>
> Was this done on purpose or is this a 'feature' ?
>
> Cheers,
>
>    Paul
>
> --
>
> * * * * * * * * http://www.mssl.ucl.ac.uk/~npmk/ * * * *
> Dr. N.P.M. Kuin      (n.kuin@ucl.ac.uk)
> phone +44-(0)1483 (prefix) -204927 (work) -276110 (home)
> mobile +44(0)7806985366  skype ID: npkuin
> Mullard Space Science Laboratory  – University College London  –
> Holmbury St Mary – Dorking – Surrey RH5 6NT–  U.K.
> _______________________________________________
> AstroPy mailing list
> AstroPy@scipy.org
> http://mail.scipy.org/mailman/listinfo/astropy


More information about the AstroPy mailing list