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

Home » Public Forums » archive » Combing 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
Combing structures [message #71194] Mon, 07 June 2010 08:01 Go to previous message
Michael Williams is currently offline  Michael Williams
Messages: 17
Registered: December 2008
Junior Member
Hi,

I have two structures. Each contains a unique set of tags whose values
are floats or arrays of floats. E.g.

xx = findgen(5)
y = 1.0
str1 = {one: xx, two:y}

xx = findgen(3)
y = -1.0
str2 = {three: xx, four: y}

I want to merge them into one flat structure of their elements. At the
moment I am doing this manually:

str = {one:str1.one, two:str1.two, three:str2.three, four:str2.four}

This obviously becomes unwieldy and error-prone when my structures
have several dozen tags. Is there a way of automating the merge step?
I am happy to assume the tag names are unique (i.e. there is no danger
of a collision).

I have played around with the tag_names function, but I can't see a
way of using this without using the EVALUATE function, which is
generally a bad idea.

-- Mike
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Smoothing Spline -- any existing efficient routines?
Next Topic: Re: getting GeoTiff Information

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

Current Time: Wed Oct 08 15:58:54 PDT 2025

Total time taken to generate the page: 0.03374 seconds