[Numpy-discussion] bug in pyfits w/ numarray 1.2

Sebastian Haase haase at msg.ucsf.edu
Tue Mar 1 09:43:31 CST 2005


Hi,
After upgrading to the latest numarray we get this error from pyfits:
>>> a = U.loadFits(fn)
Traceback (most recent call last):
  File "<input>", line 1, in ?
  File "/jws30/haase/PrLin/Priithon/useful.py", line 1069, in loadFits
    return ff[ slot ].data
  File "/jws30/haase/PrLin/pyfits.py", line 1874, in __getattr__
    raw_data = num.fromfile(self._file, type=code, shape=dims)
  File "/jws30/haase/PrLin0/numarray/numarraycore.py", line 517, in fromfile
    bytesleft=type.bytes*_gen.product(shape)
AttributeError: 'str' object has no attribute 'bytes'
>>>pyfits.__version__
'0.9.3 (June 30, 2004)'

Looks like pyfits uses a typecode-string 'code'
in this line 1874:
raw_data = num.fromfile(self._file, type=code, shape=dims)

I this supposed to still work in numarray ? Or should pyfits be updated ?
I tried  num.fromfile(self._file, typecode=code, shape=dims)
but 'typecode' doesn't seem an allowed keyword for fromfile()

Thanks,
Sebastian Haase






More information about the Numpy-discussion mailing list