[SciPy-dev] big in records fromfile

Travis Oliphant oliphant at ee.byu.edu
Wed Dec 28 14:09:40 CST 2005

Christopher Hanley wrote:

>In [1]: import scipy.base
>In [2]: from scipy.base import records as rec
>In [3]: fd = open("testdata.fits")
>In [4]: fd.seek(2880*2)
>In [5]: r = rec.fromfile(fd, formats='f8,i4,a5', shape=3, byteorder='big')
>In [6]: r[0]
>Out[6]: (1.2475423563769078e+190, 1023410176, 'abcde')
>In [7]: print r[0]
>(1.2475423563769078e+190, 1023410176, 'abcde')
Found the problem.  I was ignoring byteorder in fromfile.  I just needed 
to pass it along to the recarray constructor and it seems to be fixed.   
I've checked in the change.

The testdata.fits file seems plenty small enough to include directly, so 
go ahead.  


More information about the Scipy-dev mailing list