Hi all,
I apologize if this has been discussed, but I could not find any information
in the archives. I am creating HDF5 files with 3-D arrays in Fortran 90, and
I need to read them in both Python and MATLAB. While MATLAB recognizes the
correct dimensions of the arrays, PyTables gets them backwards (i.e. (x,y,z)
in Fortran becomes (z,y,x) when PyTables reads it). I know that this is due
to the fact that the order in which Fortran stores arrays is different than
that of Python, C or MATLAB, and I couldn't determine how exactly MATLAB
'knows' that Fortran arrays are being read. I have tried using the
'isfortran' command in numpy, but I get the following error:
>>> hh5f.root
/ (RootGroup) ''
children := ['eta' (Array), 'u' (Array), 'w' (Array), 'v' (Array), 'y'
(Array), 'x' (Array), 'z' (Array)]
>>> hh5f.root.v
/v (Array(16L, 33L, 32L)) ''
atom := Float64Atom(shape=(), dflt=0.0)
maindim := 0
flavor := 'numpy'
byteorder := 'little'
chunkshape := None
>>> numpy.isfortran(hh5f.root.v)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/sw/lib/python2.5/site-packages/numpy/core/numeric.py", line 184, in
isfortran
return a.flags.fnc
AttributeError: 'Array' object has no attribute 'flags'
It seems like there is perhaps some kind of flag I should add when writing
in Fortran to indicate that the array is in Fortran order, but MATLAB
somehow seems to know that anyway. Any advice would be greatly appreciated.
Thank you,
Milos Ilak
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Pytables-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pytables-users