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

Home » Public Forums » archive » Name of arrays
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: Name of arrays [message #79324 is a reply to message #79269] Tue, 21 February 2012 13:43 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Israel Rodriguez Hermelo writes:

> I've been trying to work with structures and pointers for a while but
> I found them confusing. I can not stop thinking about the solution of
> my problem with IDL v8.
>
> If I understand right, these few lines would resolve my problems:
>
> MONTH=['MARCH','JULY']
>
> DAY=HASH()
> TEMPERATURE=HASH()
>
> Nmonth=N_ELEMENTS(MONTH)
>
> for i=0, Nmonth-1 do begin
>
> readcol, 'DATA_'+MONTH(i)+'.txt', D, T
>
> DAY[MONTH(i)]=D
> TEMPERATURE[MONTH(i)]=T
>
> endfor
>
> plot, DAY[MONTH(0)], TEMPERATURE[MONTH(0)]
> oplot, DAY[MONTH(1)], TEMPERATURE[MONTH(1)]
>
>
> Would this code work? If the answer is yes, then I need to talk with
> my boss about IDL v8 ;)

A hash is nothing more than an fancy interface for
pointers. If you want to use one in your version of
IDL, you can use Craig's:

http://cow.physics.wisc.edu/~craigm/idl/arrays.html

But, I don't know how you would ever understand what
a hash was without knowing at least *something* about
pointers.

Craig's structure was a form of a hash, where the "key"
is really the structure tag.

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: GRIB Webinar
Next Topic: Re: new graphics error message [_IDLITCONTAINER::SETPROPERTY]

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

Current Time: Fri Oct 10 02:48:55 PDT 2025

Total time taken to generate the page: 1.03833 seconds