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

Home » Public Forums » archive » Re: Python reader for IDL save files.
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: Python reader for IDL save files. [message #44267 is a reply to message #44263] Thu, 02 June 2005 00:30 Go to previous messageGo to previous message
Chris Lee is currently offline  Chris Lee
Messages: 101
Registered: August 2003
Senior Member
In article <1117675749.189108.60990@z14g2000cwz.googlegroups.com>,
"Unknown" <lefsky@gmail.com> wrote:


> I have two questions:
> 1. Has anyone worked on the problem of reading IDL save files from
> within python? This seems like a reasonable project for the usual IDL
> variable types.
> 2. The only problem I have thought of is how to represent arrays of IDL
> structures in Python. The one attempt I made at this was succesful, but
> the resulting data structures (lists of lists, I think) were very slow
> to work with. Has anyone worked on this problem? M
>

I may be wrong, but I thought IDL didn't use arrays of structures, it
used a single structure of arrays, which is why structure have to conform
to be put into the same array

IDL> help, [{b:2,c:3}, {a:2,c:3}]
<Expression> STRUCT = -> <Anonymous> Array[2]
IDL> help, [{b:2,c:3}, {a:2,c:3d}]
% Conflicting data structures:
IDL> help, [{b:2,c:3}, {a:2,c:3,d:3}]
% Conflicting data structures:

If you want to store these in a python 'structure', then I'd guess a
dictionary is what you want, e.g. s={'a':[1,2,3], 'b':['bob','joe','fred']}, but you
would probably need to use a class and redefine the __getattr__ method
or similar if you want the access method to be s[0].b

Chris.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: LIDAR .las format
Next Topic: Re: extracting values from an array

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

Current Time: Sat Oct 11 07:54:22 PDT 2025

Total time taken to generate the page: 1.04330 seconds