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

Home » Public Forums » archive » Structures and arrays 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: Structures and arrays of structures [message #93819 is a reply to message #93817] Fri, 28 October 2016 05:04 Go to previous messageGo to previous message
Markus Schmassmann is currently offline  Markus Schmassmann
Messages: 129
Registered: April 2016
Senior Member
On 10/28/2016 12:12 PM, rjp23@le.ac.uk wrote:
> This has me stumped at the minute so I was hoping someone could help as I thought it SHOULD be simple.
>
> I have a anonymous structure in this form:
>
> IDL> help, global_struct
> ** Structure <8341ea08>, 15 tags, length=138736, data length=138736, refs=1:
> DATE FLOAT Array[2392]
> ORIG FLOAT Array[2392]
> FUNC FLOAT Array[2392]
> POLY FLOAT Array[2392]
>
> I have a second anonymous structure in this form:
>
> IDL> help,aus_struct
> ** Structure <838a5ee8>, 15 tags, length=135780, data length=135778, refs=1:
> DATE FLOAT Array[2341]
> ORIG FLOAT Array[2341]
> FUNC FLOAT Array[2341]
> POLY FLOAT Array[2341]
>
> I have many other structures in the same form and want them all to
> be contained in one item so they can be easily passed into other
> procedures, etc.
>
> The tag names within the structure are the same so I can use code
> generically on any of them.
>
> The structure name itself is generated from a string array
> ['global','aus', 'europe', 'us', etc]
>
> I can't concatenate the structures into a single as they all have
> thesame tag names. I thought I could create an array of structures but that
> doesn't seem to work. I wondered if I could create a structure of
> structures? main.global_struct.dat, main.aus_struct.date, etc but can't
> figure out how to.
>
> Any suggestions would be really useful.
loc=['global', 'aus', 'europe', 'us']
cmd='main=create_struct('
for i=0,n_elements(loc)-1 do $
cmd+="'"+loc[i]+"_struct',"+loc[i]+"_struct,"
cmd=strmid(cmd,0,strlen(cmd)-1)+")"
void=execute(cmd)

i hope that helps, Markus
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Smoothing Spline -- any existing efficient routines?
Next Topic: Technique to find maximum in 100x100 element moving box

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

Current Time: Wed Oct 08 17:30:06 PDT 2025

Total time taken to generate the page: 0.00393 seconds