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

Home » Public Forums » archive » Re: Reading in data question
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: Reading in data question [message #66126] Mon, 20 April 2009 02:33 Go to previous message
R.Bauer is currently offline  R.Bauer
Messages: 1424
Registered: November 1998
Senior Member
David Fanning schrieb:
> tomandwilltamu08@gmail.com writes:
>
>> After going back through your code carefully, it all makes perfect
>> sense and is very well written. I'm not sure I could have thought of
>> that myself - but I guess thats why I'm the guy asking the question
>> and you're the guy answering the question...
>
> I'll just point out one other thing for the article you
> are writing. The nice thing about arrays of structures
> is that you can easily pull vectors out of the structure
> fields.
>
> So, in the example yesterday, if you wanted a vector
> of all the "int_1" values in the third "unit" in the
> file, you can do this:
>
> IDL> d = unpackData(data[2])
> IDL> help, d
> D STRUCT = -> <Anonymous> Array[5]
> IDL> vector = Reform(d.int_1[*])
> IDL> print, vector
> 1 2 3 4 5
>
> Cheers,
>
> David


and reads in combination with structures is also very nice.


IDL> a=make_Array(5,2,/ind)
IDL> help,a
A FLOAT = Array[5, 2]
IDL> print,a
0.00000 1.00000 2.00000 3.00000 4.00000
5.00000 6.00000 7.00000 8.00000 9.00000
IDL> s=replicate({a:fltarr(5)},2)
IDL> help,s
S STRUCT = -> <Anonymous> Array[2]
IDL> reads, a, s
IDL> print,s
{ 0.00000 1.00000 2.00000 3.00000 4.00000
}{
5.00000 6.00000 7.00000 8.00000 9.00000
}

Of course that is a very simple example. But you can feel the power. :)

cheers
Reimar
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Is there a command which could tell a CDF file is good or not?
Next Topic: correlation d'images

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

Current Time: Fri Oct 10 09:58:30 PDT 2025

Total time taken to generate the page: 0.96022 seconds