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 #49277 is a reply to message #49276] Mon, 10 July 2006 06:41 Go to previous messageGo to previous message
Liberum is currently offline  Liberum
Messages: 48
Registered: September 2005
Member
Maarten wrote:
> 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/

This is a very good idea. I think that I will do just that. The data
was written and read on the same machine. Silly me, I thought that
binary is just a binary but I guess not. Will try the HDF format.

Thanks,
/Sheldon
[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:44:19 PDT 2025

Total time taken to generate the page: 0.24175 seconds