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

Home » Public Forums » archive » Re: read a C written binary file with IDL
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: read a C written binary file with IDL [message #79234 is a reply to message #79232] Thu, 09 February 2012 21:08 Go to previous messageGo to previous message
Thibault Garel is currently offline  Thibault Garel
Messages: 55
Registered: October 2009
Member
Hi Manodeep,

Thanks for your reply.
It turns out that a Python script can read the file correctly:

import numpy as np

MyStruct = [ # define
MyStruct
('a' ,
np.int32),
('b' ,
np.int64),
('c' , np.int32),
('d' , np.float32)
]

f1 = open(filename, 'rb') # Open the file
S1 = np.fromfile(f1, MyStruct) # read MyStruct



However, I have to use IDL (and I do not really know much about
Python...)

Do you have any idea why Python can handle it and not IDL?

cheers
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: tracking clusters through multiple timesteps
Next Topic: Making a html image map?

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

Current Time: Fri Oct 10 04:27:29 PDT 2025

Total time taken to generate the page: 1.04100 seconds