Status of pyfits with numpy?
![](https://secure.gravatar.com/avatar/6a2a454191fa75d4114ed05836a0b924.jpg?s=120&d=mm&r=g)
Hi All, Is a numpy-compatible version of pyfits nearing stability? I see that there is a pyfits-numpy branch visible on the trac browser -- is that available and stable enough for public use? Thanks, Andrew
![](https://secure.gravatar.com/avatar/a107cb52bd7c6ed14bb2dc43f1d9d63e.jpg?s=120&d=mm&r=g)
On 3/16/06, Andrew Jaffe <a.h.jaffe@gmail.com> wrote:
Hi All,
Is a numpy-compatible version of pyfits nearing stability? I see that there is a pyfits-numpy branch visible on the trac browser -- is that available and stable enough for public use?
I received the following Email from Chris Hanley, who is doing the numpy port, a few days ago. -- Paul I've finished the initial pyfits numpy port. We won't be doing an alpha release until after we finish the spring STSDAS release. We are in the process of freezing this week. I thought you might want a preview. If you do, you can grab it our of subversion with, svn co http://astropy.scipy.org/svn/pyfits/branches/pyfits-numpypyfits-numpy. That version of pyfits will support both numpy and numarray. If you have both numpy and numarray installed you can make pyfits switch between them by setting an environment variable called NUMERIX. NUMERIX = 'numarray' for numarray. NUMERIX = 'numpy' for numpy. If the variable isn't set, and both packages are installed, pyfits will default to the numarray version. If only one package is installed then pyfits will use that package. Most of the differences for image support are in syntax. However, for table support I had to completely rework the inheritance structure. Be warned, I am certain there are bugs.
![](https://secure.gravatar.com/avatar/88f208b3eec769ca044600e19341dbcf.jpg?s=120&d=mm&r=g)
Andrew, We are in the process of preparing an "alpha" release of a numpy-compatible version of pyfits. I have recently merged my numpy-pyfits branch with the pyfits trunk so if you do not wish to wait for a release you can grab it our of SVN with: svn co http://astropy.scipy.org/svn/pyfits/trunk pyfits This version of pyfits is not well tested but you are welcome to try it out and send me bug reports. A couple of people have already tried an earlier version and have reported some issues with the table support. We are currently working to address those issues. If you have both numpy and numarray installed you can make pyfits switch between them by setting an environment variable called NUMERIX. NUMERIX = 'numarray' for numarray. NUMERIX = 'numpy' for numpy. If the variable isn't set, and both packages are installed, pyfits will default to the numarray version. If only one package is installed then pyfits will use that package. Chris Andrew Jaffe wrote:
Hi All,
Is a numpy-compatible version of pyfits nearing stability? I see that there is a pyfits-numpy branch visible on the trac browser -- is that available and stable enough for public use?
Thanks,
Andrew
![](https://secure.gravatar.com/avatar/6a2a454191fa75d4114ed05836a0b924.jpg?s=120&d=mm&r=g)
Dear Chris, Thanks -- that's great. In a quick sprint to read the new WMAP satellite data, the table support seems to work for me at first glance. Can I ask what sort of trouble has been reported? Andrew Christopher Hanley wrote:
Andrew,
We are in the process of preparing an "alpha" release of a numpy-compatible version of pyfits. I have recently merged my numpy-pyfits branch with the pyfits trunk so if you do not wish to wait for a release you can grab it our of SVN with:
svn co http://astropy.scipy.org/svn/pyfits/trunk pyfits
This version of pyfits is not well tested but you are welcome to try it out and send me bug reports.
A couple of people have already tried an earlier version and have reported some issues with the table support. We are currently working to address those issues.
If you have both numpy and numarray installed you can make pyfits switch between them by setting an environment variable called NUMERIX. NUMERIX = 'numarray' for numarray. NUMERIX = 'numpy' for numpy. If the variable isn't set, and both packages are installed, pyfits will default to the numarray version. If only one package is installed then pyfits will use that package.
Chris
Andrew Jaffe wrote:
Hi All,
Is a numpy-compatible version of pyfits nearing stability? I see that there is a pyfits-numpy branch visible on the trac browser -- is that available and stable enough for public use?
Thanks,
Andrew
------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
![](https://secure.gravatar.com/avatar/c7976f03fcae7e1199d28d1c20e34647.jpg?s=120&d=mm&r=g)
Andrew Jaffe wrote:
Dear Chris,
Thanks -- that's great. In a quick sprint to read the new WMAP satellite data, the table support seems to work for me at first glance. Can I ask what sort of trouble has been reported?
Andrew
It's possible to construct new tables using the Coldef mechanism that will fail because Coldef allows one to associate arrays of higher precision than the column definition allows. When this used to create a table it fails since numpy doesn't allow downcasting assignments. We are changing it so that the column constructor explicitly downcasts any arrays (and raises an exception if you try to downcast integer arrays that won't fit in the new size). If you aren't trying to construct new tables from scratch, you won't encounter this. Perry
participants (4)
-
Andrew Jaffe
-
Christopher Hanley
-
Paul Barrett
-
Perry Greenfield