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

Home » Public Forums » archive » basic array-structure understanding question
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
basic array-structure understanding question [message #63682] Wed, 19 November 2008 06:21 Go to next message
julia.walterspiel is currently offline  julia.walterspiel
Messages: 35
Registered: July 2008
Member
hi everybody

This is what does not get into my head:

I have one array containing my data.
I have a second array containing the times when the data was
collected.
They have the same lenght.

I put them into one structure because we all like structures and I
learned about their advantages.

now:

IN SHORT are those arrays linked somehow? in other words: when working
with a structure, does IDL know which value matches the corresponding
date, given the data and the date array have the same length. Are
those arrays somehow connected or are they completely independent from
each other?


IN LONG: if I want to get e.g. all the data from all Januarys from
2000 to 2007, can I do it somehow like

all_jan = structure.data (where(structure.time EQ 200?01??????) )..
then it would automatically "select" only the right values. (and then
I would have to make a separate array of the corresponding dates, make
those two new arrays a structure so that I can plot data vs. date all
in one?)

or do I have to do it via some indexing, like:
all_jan = where (structure.time EQ 200?01??????) )

and then apply the index to my array of data?


jeez, i'm real slow on the uptake here.. sorry for bothering you with
such simple questions, but can anybody help me undo this big knot in
my brain?
cheers,
juls
Re: basic array-structure understanding question [message #63778 is a reply to message #63682] Thu, 20 November 2008 01:38 Go to previous messageGo to next message
julia.walterspiel is currently offline  julia.walterspiel
Messages: 35
Registered: July 2008
Member
>
> eth?


war an der ETH/Uni ZH, jetzt an der MeteoSchweiz (Pendant zum DWD),
und die arbeiten "leider" nicht mit Matlab sondern IDL.. back to
square one
Re: basic array-structure understanding question [message #63782 is a reply to message #63682] Thu, 20 November 2008 01:12 Go to previous messageGo to next message
R.Bauer is currently offline  R.Bauer
Messages: 1424
Registered: November 1998
Senior Member
julia.walterspiel@gmail.com schrieb:
> thanks Reimar for the link
> no need to translate it, bin aus der schweiz :)


eth?

Gruss
Reimar
Re: basic array-structure understanding question [message #63785 is a reply to message #63682] Thu, 20 November 2008 01:02 Go to previous messageGo to next message
julia.walterspiel is currently offline  julia.walterspiel
Messages: 35
Registered: July 2008
Member
thanks Reimar for the link
no need to translate it, bin aus der schweiz :)
Re: basic array-structure understanding question [message #63786 is a reply to message #63682] Thu, 20 November 2008 00:46 Go to previous messageGo to next message
R.Bauer is currently offline  R.Bauer
Messages: 1424
Registered: November 1998
Senior Member
julia.walterspiel@gmail.com schrieb:
> hi everybody
>
> This is what does not get into my head:
>
> I have one array containing my data.
> I have a second array containing the times when the data was
> collected.
> They have the same lenght.
>
> I put them into one structure because we all like structures and I
> learned about their advantages.
>

Hi Julia

you may want to read examples in
http://www.fz-juelich.de/zb/datapool/page/439/00322_Bauer.pd f

page 49++

you can use google.com/translate_t to translate it.

cheers
Reimar

> now:
>
> IN SHORT are those arrays linked somehow? in other words: when working
> with a structure, does IDL know which value matches the corresponding
> date, given the data and the date array have the same length. Are
> those arrays somehow connected or are they completely independent from
> each other?
>
>
> IN LONG: if I want to get e.g. all the data from all Januarys from
> 2000 to 2007, can I do it somehow like
>
> all_jan = structure.data (where(structure.time EQ 200?01??????) )..
> then it would automatically "select" only the right values. (and then
> I would have to make a separate array of the corresponding dates, make
> those two new arrays a structure so that I can plot data vs. date all
> in one?)
>
> or do I have to do it via some indexing, like:
> all_jan = where (structure.time EQ 200?01??????) )
>
> and then apply the index to my array of data?
>
>
> jeez, i'm real slow on the uptake here.. sorry for bothering you with
> such simple questions, but can anybody help me undo this big knot in
> my brain?
> cheers,
> juls
Re: basic array-structure understanding question [message #63789 is a reply to message #63682] Thu, 20 November 2008 00:13 Go to previous messageGo to next message
julia.walterspiel is currently offline  julia.walterspiel
Messages: 35
Registered: July 2008
Member
> An IDL structure is just a container, into which you can put a
> collection of (related) variables.  Then you can pass the
> structure around, instead of having to pass all of the variables
> individually.

well put, thank you all.
juls
Re: basic array-structure understanding question [message #63799 is a reply to message #63682] Wed, 19 November 2008 07:10 Go to previous messageGo to next message
Kenneth P. Bowman is currently offline  Kenneth P. Bowman
Messages: 585
Registered: May 2000
Senior Member
In article
<68a3f7b5-1c15-4dbb-bf83-b019eb7dd204@g17g2000prg.googlegroups.com>,
julia.walterspiel@gmail.com wrote:

> hi everybody
>
> This is what does not get into my head:
>
> I have one array containing my data.
> I have a second array containing the times when the data was
> collected.
> They have the same lenght.
>
> I put them into one structure because we all like structures and I
> learned about their advantages.
>
> now:
>
> IN SHORT are those arrays linked somehow? in other words: when working
> with a structure, does IDL know which value matches the corresponding
> date, given the data and the date array have the same length. Are
> those arrays somehow connected or are they completely independent from
> each other?
>
>
> IN LONG: if I want to get e.g. all the data from all Januarys from
> 2000 to 2007, can I do it somehow like
>
> all_jan = structure.data (where(structure.time EQ 200?01??????) )..
> then it would automatically "select" only the right values. (and then
> I would have to make a separate array of the corresponding dates, make
> those two new arrays a structure so that I can plot data vs. date all
> in one?)
>
> or do I have to do it via some indexing, like:
> all_jan = where (structure.time EQ 200?01??????) )
>
> and then apply the index to my array of data?
>
>
> jeez, i'm real slow on the uptake here.. sorry for bothering you with
> such simple questions, but can anybody help me undo this big knot in
> my brain?
> cheers,
> juls

An IDL structure is just a container, into which you can put a
collection of (related) variables. Then you can pass the
structure around, instead of having to pass all of the variables
individually.

IDL> x = findgen(10)^3
IDL> i = lindgen(10)
IDL> str = {x:x, i:i}
IDL> help, str, /str
** Structure <1db1314>, 2 tags, length=80, data length=80, refs=1:
X FLOAT Array[10]
I LONG Array[10]
IDL> help, str.x
<Expression> FLOAT = Array[10]
IDL> help, str.i
<Expression> LONG = Array[10]
IDL> plot, str.i, str.x
IDL> even = where((str.i MOD 2) eq 0) ;Find even indices
IDL> print, even
0 2 4 6 8
IDL> oplot, str.i[even], str.x[even], psym = -1 ;Plot even indices only


Ken Bowman
Re: basic array-structure understanding question [message #63853 is a reply to message #63682] Thu, 20 November 2008 07:49 Go to previous message
julia.walterspiel is currently offline  julia.walterspiel
Messages: 35
Registered: July 2008
Member
Na Paolo, wenn du in Boston sitzt, dann sollten dich unsere
Wetterprognosen ja nicht tangieren ;-)
aber um dich trotzdem zu beruhigen: nur die Klimaleute arbeiten mit
IDL...
grüsse vom "Züriberg"
Re: basic array-structure understanding question [message #63863 is a reply to message #63778] Thu, 20 November 2008 06:43 Go to previous message
pgrigis is currently offline  pgrigis
Messages: 436
Registered: September 2007
Senior Member
julia.waltersp...@gmail.com wrote:
>>
>> eth?
>
>
> war an der ETH/Uni ZH, jetzt an der MeteoSchweiz (Pendant zum DWD),
> und die arbeiten "leider" nicht mit Matlab sondern IDL.. back to
> square one

Ich wusste gar nicht, dass Meteosuisse IDL benutzt...
Mein Vertrauen in Wetterprognoses ist jetezt
ein bisschen gesunken ;-)

Liebe Gruesse aus Boston
Paolo Grigis (ehemalig doktorand an der ETH)
Re: basic array-structure understanding question [message #63867 is a reply to message #63682] Thu, 20 November 2008 06:00 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
julia.walterspiel@gmail.com writes:

> war an der ETH/Uni ZH, jetzt an der MeteoSchweiz (Pendant zum DWD),
> und die arbeiten "leider" nicht mit Matlab sondern IDL.. back so
> square one :)

And people ask, "Why in the world are you studying German!?"
"You just never know when it might come in handy," I answer. :-)

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Too Many Posts
Next Topic: Re: A Simple IDL Manifesto

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

Current Time: Wed Oct 08 14:00:59 PDT 2025

Total time taken to generate the page: 0.00459 seconds