
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

Sebastian Haase wrote:
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
Are you sure the value of 'slot' and 'ff' in your code are correct. pyfits 0.9.3 and numarray 1.2.2 seem to work fine for me: In [5]: f=pyfits.open(file) In [6]: v=f[0].data In [7]: v? Type: NumArray Base Class: <class 'numarray.numarraycore.NumArray'> String Form: [[ 221 171 67 ..., 112 -136 12] [ 125 78 159 ..., 249 -345 -260] [ 346 47 250 ..., <...> ..., 206 -106 -127] [ 187 16 218 ..., 342 -243 -59] [ 156 200 279 ..., 138 -209 -230]] Namespace: Interactive Length: 1024 Docstring: Fundamental Numeric Array type The type of each data element, e.g. Int32 byteorder The actual ordering of bytes in buffer: "big" or "little". In [8]: pyfits.__version__ Out[8]: '0.9.3 (June 30, 2004)' In [9]: numarray.__version__ Out[9]: '1.2.2'
participants (2)
-
Sebastian Haase
-
Stephen Walton