comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Reading binary files made by Python
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Reading binary files made by Python [message #49278 is a reply to message #49277] Mon, 10 July 2006 06:29 Go to previous message
Maarten[1] is currently offline  Maarten[1]
Messages: 176
Registered: November 2005
Senior Member
Sheldon wrote:

> I have created som binary files using python and tried to read them
> with IDL. I used the binary_template as well but IDL completely
> misinterprets the data and returns wrong values and values that were
> never written in the file. Now Matlab is able to read these files
> without problem. My question is why is IDL failing to do this? I know
> that the binaries are Float32 and the dimensions are correct. I am
> doing something wrong?

Without actually seeing the code you used to write the files, it seems
a bit hard to answer this question. One obvious issue is the endianess
of the data, I don't know what python, IDL or matlab assume about that
(I guess you use the same machine to write and read the data).

I would recommend to write out the data in a portable file format, like
HDF (pytables is an easy way to do that). You can then use the idl HDF
routines to ingest the data, avoiding the larger part of the headaches.

Maarten

pytables: http://www.pytables.org/
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: format codes
Next Topic: Reading Binary

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Oct 11 04:52:03 PDT 2025

Total time taken to generate the page: 1.59873 seconds