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

Home » Public Forums » archive » Re: Expanding Arrays of Structures
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Expanding Arrays of Structures [message #50349] Thu, 28 September 2006 08:50 Go to next message
Foldy Lajos is currently offline  Foldy Lajos
Messages: 268
Registered: October 2001
Senior Member
On Thu, 28 Sep 2006, Haje Korth wrote:

> Hi,
> It's one of those days. You think you know IDL but you really don't.
> Well, may be someone can help.
>
> I have an array of structures created like
> s1={a:0,b:0,c:0}
> s2=replicate(s1,10)
>
> Is there a way to expand this array by another tag "d" so that
> essentially every array index contains the structure {a,b,c,d}?
>
> The reason why I don't include "d" right away is thatI read the
> structure content from files, where the additional variable is not
> available.
>
> I have looked at struct_assign and create_struct, but I don't think
> they can do what I want.
>
> Does anyone have any idea except copying every freakin' tag
> separately???
>
> Thanks,
> Haje
>

Hi,

struct_assign will do the job:

s1={a:1,b:2,c:3}
s2=replicate(s1,10)

s1ext={a:1,b:2,c:3,d:4} ; you can build s1ext with create_struct
s2ext=replicate(s1ext, 10)

struct_assign, s2, s2ext


regards,
lajos
Re: Expanding Arrays of Structures [message #50478 is a reply to message #50349] Fri, 29 September 2006 05:24 Go to previous message
Haje Korth is currently offline  Haje Korth
Messages: 651
Registered: May 1997
Senior Member
Thanks, great, I was barking up the wrong tree. I tried to append the
original structure by the new tag, which did not work. It did not
occurr to me that the solution is to regenerate the entire structure
including the new tags.

Haje

PS: Sorry for the double post... It's Googles fault... :-)


FĂ–LDY Lajos wrote:
> On Thu, 28 Sep 2006, Haje Korth wrote:
>
>> Hi,
>> It's one of those days. You think you know IDL but you really don't.
>> Well, may be someone can help.
>>
>> I have an array of structures created like
>> s1={a:0,b:0,c:0}
>> s2=replicate(s1,10)
>>
>> Is there a way to expand this array by another tag "d" so that
>> essentially every array index contains the structure {a,b,c,d}?
>>
>> The reason why I don't include "d" right away is thatI read the
>> structure content from files, where the additional variable is not
>> available.
>>
>> I have looked at struct_assign and create_struct, but I don't think
>> they can do what I want.
>>
>> Does anyone have any idea except copying every freakin' tag
>> separately???
>>
>> Thanks,
>> Haje
>>
>
> Hi,
>
> struct_assign will do the job:
>
> s1={a:1,b:2,c:3}
> s2=replicate(s1,10)
>
> s1ext={a:1,b:2,c:3,d:4} ; you can build s1ext with create_struct
> s2ext=replicate(s1ext, 10)
>
> struct_assign, s2, s2ext
>
>
> regards,
> lajos
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: subset an image by roi in idl
Next Topic: Structure Arrays

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

Current Time: Fri Oct 10 11:43:58 PDT 2025

Total time taken to generate the page: 0.40090 seconds