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

Home » Public Forums » archive » Re: Structure of arrays or 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: Structure of arrays or arrays of structures? [message #64847 is a reply to message #64846] Thu, 22 January 2009 14:32 Go to previous message
Michael Galloy is currently offline  Michael Galloy
Messages: 1114
Registered: April 2006
Senior Member
On Jan 22, 1:52 pm, Brian Larsen <balar...@gmail.com> wrote:
> I prefer the feel of the structure of arrays since I like typing
>    tmp = data.jd[0:10]
> more than I like typing
>    tmp = data[0:10].jd

You can use either notation with an array of structures:

IDL> s = replicate({ a: 0, b: 0 }, 10)
IDL> s.a = findgen(10)
IDL> s.b = 3
IDL> print, s.a
0 1 2 3 4 5 6 7
8 9
IDL> print, s.b
3 3 3 3 3 3 3 3
3 3
IDL> print, s[7]
{ 7 3}

Mike
--
www.michaelgalloy.com
Tech-X Corporation
Associate Research Scientist
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: BAR_PLOT with pairs of bars
Next Topic: A new version of GRAFFER

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

Current Time: Sat Oct 11 03:42:59 PDT 2025

Total time taken to generate the page: 0.64511 seconds