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

Home » Public Forums » archive » Re: indexing structure of structures
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: indexing structure of structures [message #49370] Tue, 18 July 2006 08:28 Go to previous message
Phony Account is currently offline  Phony Account
Messages: 14
Registered: May 2005
Junior Member
Ben Tupper wrote:
> phaccount@nycap.rr.com wrote:
>> Hello group,
>>
>> I am analyzing a bunch of data from an experimental series. The
>> analysis from each experiment (numbers a,b,c,... etc) is stored in a
>> structure. For reasons that have little to do with foresight and
>> expedience, I decided to store all the individual structures in one
>> large structure (This allows me to add some more fluff).
>>
>> My problem is how to extract the parameter 'a' to plot it. I was
>> hoping that an array indexing method such as
>>
>> outer_struct.([1,4,8,12]).a
>>
>> would work, but it does not. So I am re-packaging the outer structure
>> as a vector of inner_structures.
>>
>> Am I missing something in the IDL syntax that would allow me to keep
>> the structure of structures, and vectorially index the substructures?
>>
>
> Hello,
>
> I think you really do want a vector of stuctures - assuming that each of
> the structures have the same form. If that is what you want then the
> notation is very simple. Try the following...
>
> vec = REPLICATE($
> {NAME: STRING(randomn(n, 1)*100, format = '(I3.3)'), $
> DATA: INDGEN(4)}, 5)
> help, vec
> subvec = vec[2:4]
> help, subvec
> subname = vec[2:4].name
> help, subname
> subdata = vec[2:4].data
> help, subdata
> subsubdata = vec[2:4].data[3]
> help, subsubdata
>
> Cheers,
> Ben

Yep, that is the way I finally went.

Thanks Ben,

Mirko
[Message index]
 
Read Message
Read Message
Previous Topic: How to save output log by profiler
Next Topic: Refine a vector layer in ENVI

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

Current Time: Wed Oct 08 14:12:11 PDT 2025

Total time taken to generate the page: 0.00258 seconds