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 
Switch to threaded view of this topic Create a new topic Submit Reply
Name of arrays [message #79269] Sun, 19 February 2012 04:30 Go to next message
Israel Rodriguez Herm is currently offline  Israel Rodriguez Herm
Messages: 13
Registered: February 2012
Junior Member
Hi there!

I'd like to use a string as part of the name of an array:

MONTH = [ 'FEBRUARY' , 'JULY' ]

TEMPERATURE+MONTH(0)=fltarr(28)

TEMPERATURE+MONTH(1)=fltarr(31)

I found any way to do this simple task. Anybody can help me?

Thanks in advance!
Re: Name of arrays [message #79305 is a reply to message #79269] Wed, 22 February 2012 08:34 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Brian Wolven writes:

> What? Is there no cg_rsi_search.pro, er, cg_ittvis_search.pro, um, I mean cg_excelis_search.pro?

Some things are hopeless and can't be fixed (apparently). :-)

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.")
Re: Name of arrays [message #79307 is a reply to message #79269] Wed, 22 February 2012 08:22 Go to previous messageGo to next message
Brian Wolven is currently offline  Brian Wolven
Messages: 94
Registered: May 2011
Member
What? Is there no cg_rsi_search.pro, er, cg_ittvis_search.pro, um, I mean cg_excelis_search.pro?
Re: Name of arrays [message #79308 is a reply to message #79269] Wed, 22 February 2012 05:28 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Israel Rodriguez Hermelo writes:

> I'm totally agree, a fancy interface for pointers is exactly what I
> need!
>
> I'm trying to download the demo version but I haven't found it. There
> is not demo version anymore?

The Search function on the Excelis web page is
designed to obfuscate the presence of anything
important, but if you wander around blindly for
a hour or so, you might chance on the IDL
download. That's what you want.

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.")
Re: Name of arrays [message #79310 is a reply to message #79269] Wed, 22 February 2012 02:04 Go to previous messageGo to next message
Israel Rodriguez Herm is currently offline  Israel Rodriguez Herm
Messages: 13
Registered: February 2012
Junior Member
I'm totally agree, a fancy interface for pointers is exactly what I
need!

I'm trying to download the demo version but I haven't found it. There
is not demo version anymore?

Regards,

Israel
Re: Name of arrays [message #79313 is a reply to message #79269] Tue, 21 February 2012 14:53 Go to previous messageGo to next message
Brian Wolven is currently offline  Brian Wolven
Messages: 94
Registered: May 2011
Member
I'm always happy to see people provide pointers on using structures. ;)

Which reminds me of this classic xkcd cartoon: http://xkcd.com/138/
Re: Name of arrays [message #79314 is a reply to message #79269] Tue, 21 February 2012 14:44 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Paul van Delst writes:

> au contraire, mon ami.
>
> Increased productivity has to come from somewhere. My (almost completely vicarious) experience with the harder core
> programmer-y types is that if a language provides the mechanism to express something in fewer keystrokes, it will catch on.
>
> Look at ruby. (although the fun-ness factor shouldn't be brushed off).
>
> Mind you, the use of an editor that is language-aware, in the hands of a master, is something to behold. I watched a web
> video once of a guy demonstrating how easy it was to set up a ruby application using rails. He hardly had to type more
> than two/three characters of the reserved words before they auto-completed. Five minutes later, he had a functioning
> blogging site set up, hooked into a database, accepted comments, etc. Coded from scratch. Took my breath away.... and
> made the fancy piece of paper from the university that is hanging on my wall seem, uh, not so special. :o)

OK, I'm going to give up trolling for the day
and admit defeat. :-)

Cheers,

David

P.S. If you come across that video again, I'd like
to see it.


--
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.")
Re: Name of arrays [message #79315 is a reply to message #79269] Tue, 21 February 2012 14:35 Go to previous messageGo to next message
Paul Van Delst[1] is currently offline  Paul Van Delst[1]
Messages: 1157
Registered: April 2002
Senior Member
David Fanning wrote:
> Paul van Delst writes:
>
>> But, to get back to David's original point, one should
>> not treat syntactic sugar with disdain. IMO, for the 99.9%
>> of programmers out there (most definitely including moi),
>> a fancy interface for pointers -- that does not expose the
>> pointer-y-ness -- is *exactly* what is needed (I cringe
>> when I look at some of my older widget programs...).
>>
>> Long live the hash().
>
> I'm not sure the correct term for people who desire syntactic
> sugariness is "programmer". "Scientist", more like. ;-)

au contraire, mon ami.

Increased productivity has to come from somewhere. My (almost completely vicarious) experience with the harder core
programmer-y types is that if a language provides the mechanism to express something in fewer keystrokes, it will catch on.

Look at ruby. (although the fun-ness factor shouldn't be brushed off).

Mind you, the use of an editor that is language-aware, in the hands of a master, is something to behold. I watched a web
video once of a guy demonstrating how easy it was to set up a ruby application using rails. He hardly had to type more
than two/three characters of the reserved words before they auto-completed. Five minutes later, he had a functioning
blogging site set up, hooked into a database, accepted comments, etc. Coded from scratch. Took my breath away.... and
made the fancy piece of paper from the university that is hanging on my wall seem, uh, not so special. :o)

cheers,

paulv
Re: Name of arrays [message #79316 is a reply to message #79269] Tue, 21 February 2012 14:33 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Paulo Penteado writes:

> I think that programmers trained in C++, Java or Python would cringe,
> cry and scream, a lot more than scientists, at a bunch of pointers
> used to do the work of a hash.

Humm, you are probably right. :-)

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.")
Re: Name of arrays [message #79317 is a reply to message #79269] Tue, 21 February 2012 14:27 Go to previous messageGo to next message
penteado is currently offline  penteado
Messages: 866
Registered: February 2018
Senior Member
Administrator
On Feb 21, 8:21 pm, David Fanning <n...@idlcoyote.com> wrote:
> I'm not sure the correct term for people who desire syntactic
> sugariness is "programmer". "Scientist", more like. ;-)

I think that programmers trained in C++, Java or Python would cringe,
cry and scream, a lot more than scientists, at a bunch of pointers
used to do the work of a hash.
Re: Name of arrays [message #79318 is a reply to message #79269] Tue, 21 February 2012 14:21 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Paul van Delst writes:

> But, to get back to David's original point, one should
> not treat syntactic sugar with disdain. IMO, for the 99.9%
> of programmers out there (most definitely including moi),
> a fancy interface for pointers -- that does not expose the
> pointer-y-ness -- is *exactly* what is needed (I cringe
> when I look at some of my older widget programs...).
>
> Long live the hash().

I'm not sure the correct term for people who desire syntactic
sugariness is "programmer". "Scientist", more like. ;-)

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.")
Re: Name of arrays [message #79319 is a reply to message #79269] Tue, 21 February 2012 14:02 Go to previous messageGo to next message
penteado is currently offline  penteado
Messages: 866
Registered: February 2018
Senior Member
Administrator
On Feb 21, 6:36 pm, Israel Rodriguez Hermelo <israelherm...@gmail.com>
wrote:
> Would this code work? If the answer is yes, then I need to talk with
> my boss about IDL v8 ;)

Yes, it would work.

As David said, you could do it with CM's hashtable. For IDL pre-8.0,
it would be something like:

MONTH=['MARCH','JULY']

DAY=obj_new('hashtable')
TEMPERATURE=bj_new('hashtable')

Nmonth=N_ELEMENTS(MONTH)

for i=0, Nmonth-1 do begin

readcol, 'DATA_'+MONTH(i)+'.txt', D, T

DAY->add,D
TEMPERATURE->add,T

endfor

plot, DAY->get(MONTH[0]), temperature->get(MONTH[0])
oplot, DAY->get(MONTH[1]), TEMPERATURE->get(MONTH[1])
Re: Name of arrays [message #79320 is a reply to message #79269] Tue, 21 February 2012 14:11 Go to previous messageGo to next message
penteado is currently offline  penteado
Messages: 866
Registered: February 2018
Senior Member
Administrator
On Feb 21, 8:09 pm, Paul van Delst <paul.vande...@noaa.gov> wrote:
> But, to get back to David's original point, one should not treat syntactic sugar with disdain. IMO, for the 99.9% of
> programmers out there (most definitely including moi), a fancy interface for pointers -- that does not expose the
> pointer-y-ness -- is *exactly* what is needed (I cringe when I look at some of my older widget programs...).
>
> Long live the hash().

I was thinking just about that. I was about to leave IDL because of
its lack of lists and hashes, when 8.0 came along.
Re: Name of arrays [message #79321 is a reply to message #79269] Tue, 21 February 2012 14:09 Go to previous messageGo to next message
Paul Van Delst[1] is currently offline  Paul Van Delst[1]
Messages: 1157
Registered: April 2002
Senior Member
Ha! :o)

Early on, IDL was a fancy interface for Fortran. (Just like matlab :o)

But, to get back to David's original point, one should not treat syntactic sugar with disdain. IMO, for the 99.9% of
programmers out there (most definitely including moi), a fancy interface for pointers -- that does not expose the
pointer-y-ness -- is *exactly* what is needed (I cringe when I look at some of my older widget programs...).

Long live the hash().

cheers,

paulv


Paulo Penteado wrote:
> On Feb 21, 7:43 pm, David Fanning <n...@idlcoyote.com> wrote:
>> A hash is nothing more than an fancy interface for
>> pointers.
>
> So, similarly, IDL is nothing more than a fancy interface for C?
Re: Name of arrays [message #79322 is a reply to message #79269] Tue, 21 February 2012 14:06 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Paulo Penteado writes:

> So, similarly, IDL is nothing more than a fancy interface for C?

More of an advertisement for C, or at least Python. At least,
lately. ;-)

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.")
Re: Name of arrays [message #79323 is a reply to message #79269] Tue, 21 February 2012 13:58 Go to previous messageGo to next message
penteado is currently offline  penteado
Messages: 866
Registered: February 2018
Senior Member
Administrator
On Feb 21, 7:43 pm, David Fanning <n...@idlcoyote.com> wrote:
> A hash is nothing more than an fancy interface for
> pointers.

So, similarly, IDL is nothing more than a fancy interface for C?
Re: Name of arrays [message #79324 is a reply to message #79269] Tue, 21 February 2012 13:43 Go to previous messageGo to next 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.")
Re: Name of arrays [message #79325 is a reply to message #79269] Tue, 21 February 2012 12:36 Go to previous messageGo to next message
Israel Rodriguez Herm is currently offline  Israel Rodriguez Herm
Messages: 13
Registered: February 2012
Junior Member
Hi!

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 ;)

Regards,

Israel
Re: Name of arrays [message #79327 is a reply to message #79269] Tue, 21 February 2012 08:38 Go to previous messageGo to next message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
On Feb 21, 10:12 am, David Fanning <n...@idlcoyote.com> wrote:
> Craig Markwardt writes:
>> No, structures are easy.  You can add as many elements as you want and
>> they can be any size that you want.
>
>> ; First you create a dummy structure, or add some overall "metadata"
>> information if you want.
>> my_struct = {file_date:'2012-01-03'}  ;; Whatever you want
>
>> ; Then add as many data points as you want.
>> my_struct = create_struct(my_struct, TEMPERATURE+MONTH(0), fltarr(28))
>> my_struct = create_struct(my_struct, TEMPERATURE+MONTH(1), fltarr(30))
>> ...
>> my_struct = create_struct(my_struct, TEMPERATURE+MONTH(11),
>> fltarr(30))
>
>> Pointers introduce their own overhead of allocating, managing and de-
>> allocating them.  Structures are totally extensible and have basically
>> no mental overhead.
>
>> Later on, you can retrieve the contents with TAG_NAMES(), and the
>> "structure array" notation my_struct.(N).
>
> See, what did I tell you? Structures are totally inflexible,
> unless you know what you are doing with them. ;-)

It's just a matter of which foot you shoot. :-)
Re: Name of arrays [message #79328 is a reply to message #79269] Tue, 21 February 2012 07:12 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Craig Markwardt writes:

> No, structures are easy. You can add as many elements as you want and
> they can be any size that you want.
>
> ; First you create a dummy structure, or add some overall "metadata"
> information if you want.
> my_struct = {file_date:'2012-01-03'} ;; Whatever you want
>
> ; Then add as many data points as you want.
> my_struct = create_struct(my_struct, TEMPERATURE+MONTH(0), fltarr(28))
> my_struct = create_struct(my_struct, TEMPERATURE+MONTH(1), fltarr(30))
> ...
> my_struct = create_struct(my_struct, TEMPERATURE+MONTH(11),
> fltarr(30))
>
> Pointers introduce their own overhead of allocating, managing and de-
> allocating them. Structures are totally extensible and have basically
> no mental overhead.
>
> Later on, you can retrieve the contents with TAG_NAMES(), and the
> "structure array" notation my_struct.(N).

See, what did I tell you? Structures are totally inflexible,
unless you know what you are doing with them. ;-)

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.")
Re: Name of arrays [message #79329 is a reply to message #79269] Tue, 21 February 2012 06:49 Go to previous messageGo to next message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
On Feb 21, 9:35 am, Israel Rodriguez Hermelo <israelherm...@gmail.com>
wrote:
> On Feb 21, 2:36 pm, David Fanning <n...@idlcoyote.com> wrote:
>
>
>
>
>
>
>
>
>
>> Israel Rodriguez Hermelo writes:
>>> First of all, I want to thank you all of you for your suggestions.
>>> Second, just say that all this months, days and temperatures was just
>>> an example of what I want to do, so I need a general way to proceed.
>>> Third, I'm running IDL v7, so the solutions for IDL v8 don't work for
>>> me.
>
>>> So I'm trying to learn how to use structures, but they are a bit
>>> confusing to me and the information I have obtained from google is not
>>> helping too much. I would appreciate any example or link to a webpage
>>> showing how to use structures. Thanks in advance!
>
>> Structures!? You mean pointers, right? You need
>> flexibility and structures are, well, just about
>> the least flexible solution of all time. Are you
>> sure you mean structures?
>
>> 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.")
>
> hehe yes, I was trying to do it with structures but I was already
> thinking that structures are not flexible enough. I'll try with
> pointers then. I'll let you know how it goes.
>

No, structures are easy. You can add as many elements as you want and
they can be any size that you want.

; First you create a dummy structure, or add some overall "metadata"
information if you want.
my_struct = {file_date:'2012-01-03'} ;; Whatever you want

; Then add as many data points as you want.
my_struct = create_struct(my_struct, TEMPERATURE+MONTH(0), fltarr(28))
my_struct = create_struct(my_struct, TEMPERATURE+MONTH(1), fltarr(30))
...
my_struct = create_struct(my_struct, TEMPERATURE+MONTH(11),
fltarr(30))

Pointers introduce their own overhead of allocating, managing and de-
allocating them. Structures are totally extensible and have basically
no mental overhead.

Later on, you can retrieve the contents with TAG_NAMES(), and the
"structure array" notation my_struct.(N).

Craig
Re: Name of arrays [message #79330 is a reply to message #79269] Tue, 21 February 2012 06:50 Go to previous messageGo to next message
Paul Van Delst[1] is currently offline  Paul Van Delst[1]
Messages: 1157
Registered: April 2002
Senior Member
Craig Markwardt wrote:
> On Feb 20, 1:15 pm, Brian Wolven <brian.wol...@gmail.com> wrote:
>> Or create_struct, using the month as the tag name, for pretty much any version of IDL.
>
> +1.

and once more: +1.

To the OP, it's quite easy to modify structures as you go - as long as you use anonymous structure. So in your case you
could do something like:

IDL> t = findgen(31)
IDL> month_data = create_struct('january', t)
IDL> help, month_data
** Structure <9430c3c>, 1 tags, length=124, data length=124, refs=1:
JANUARY FLOAT Array[31]
IDL> print, month_data.january
0.00000 1.00000 2.00000 3.00000 4.00000 5.00000 6.00000
7.00000 8.00000 9.00000 10.0000 11.0000 12.0000 13.0000
14.0000 15.0000 16.0000 17.0000 18.0000 19.0000 20.0000
21.0000 22.0000 23.0000 24.0000 25.0000 26.0000 27.0000
28.0000 29.0000 30.0000
IDL> t = findgen(28)+10.
IDL> month_data = create_struct(month_data,'february', t)
IDL> help, month_data
** Structure <9430f6c>, 2 tags, length=236, data length=236, refs=1:
JANUARY FLOAT Array[31]
FEBRUARY FLOAT Array[28]
IDL> print, month_data.february
10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000
17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 23.0000
24.0000 25.0000 26.0000 27.0000 28.0000 29.0000 30.0000
31.0000 32.0000 33.0000 34.0000 35.0000 36.0000 37.0000

It's like a poor man's hash, e.g.:

IDL> print, month_data.(where(tag_names(month_data) EQ 'FEBRUARY'))
10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000
17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 23.0000
24.0000 25.0000 26.0000 27.0000 28.0000 29.0000 30.0000
31.0000 32.0000 33.0000 34.0000 35.0000 36.0000 37.0000


cheers,

paulv



p.s. I reckon it's worth upgrading to v8.* to get access to IDL's HASH:

IDL> month_data=HASH()
IDL> help, month_data
MONTH_DATA HASH <ID=1 NELEMENTS=0>
IDL> month_data['January']=findgen(31)
IDL> month_data['February']=findgen(28)+10
IDL> help, month_data
MONTH_DATA HASH <ID=1 NELEMENTS=2>
IDL> print, month_data['February']
10.0000 11.0000 12.0000 13.0000 14.0000 15.0000 16.0000
17.0000 18.0000 19.0000 20.0000 21.0000 22.0000 23.0000
24.0000 25.0000 26.0000 27.0000 28.0000 29.0000 30.0000
31.0000 32.0000 33.0000 34.0000 35.0000 36.0000 37.0000

It's just simpler.
Re: Name of arrays [message #79331 is a reply to message #79269] Tue, 21 February 2012 06:35 Go to previous messageGo to next message
Israel Rodriguez Herm is currently offline  Israel Rodriguez Herm
Messages: 13
Registered: February 2012
Junior Member
On Feb 21, 2:36 pm, David Fanning <n...@idlcoyote.com> wrote:
> Israel Rodriguez Hermelo writes:
>> First of all, I want to thank you all of you for your suggestions.
>> Second, just say that all this months, days and temperatures was just
>> an example of what I want to do, so I need a general way to proceed.
>> Third, I'm running IDL v7, so the solutions for IDL v8 don't work for
>> me.
>
>> So I'm trying to learn how to use structures, but they are a bit
>> confusing to me and the information I have obtained from google is not
>> helping too much. I would appreciate any example or link to a webpage
>> showing how to use structures. Thanks in advance!
>
> Structures!? You mean pointers, right? You need
> flexibility and structures are, well, just about
> the least flexible solution of all time. Are you
> sure you mean structures?
>
> 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.")

hehe yes, I was trying to do it with structures but I was already
thinking that structures are not flexible enough. I'll try with
pointers then. I'll let you know how it goes.

Thanks again for your suggestions.

Regards,

Israel
Re: Name of arrays [message #79332 is a reply to message #79269] Tue, 21 February 2012 05:36 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Israel Rodriguez Hermelo writes:

> First of all, I want to thank you all of you for your suggestions.
> Second, just say that all this months, days and temperatures was just
> an example of what I want to do, so I need a general way to proceed.
> Third, I'm running IDL v7, so the solutions for IDL v8 don't work for
> me.
>
> So I'm trying to learn how to use structures, but they are a bit
> confusing to me and the information I have obtained from google is not
> helping too much. I would appreciate any example or link to a webpage
> showing how to use structures. Thanks in advance!

Structures!? You mean pointers, right? You need
flexibility and structures are, well, just about
the least flexible solution of all time. Are you
sure you mean structures?

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.")
Re: Name of arrays [message #79333 is a reply to message #79269] Tue, 21 February 2012 04:45 Go to previous messageGo to next message
Israel Rodriguez Herm is currently offline  Israel Rodriguez Herm
Messages: 13
Registered: February 2012
Junior Member
First of all, I want to thank you all of you for your suggestions.
Second, just say that all this months, days and temperatures was just
an example of what I want to do, so I need a general way to proceed.
Third, I'm running IDL v7, so the solutions for IDL v8 don't work for
me.

So I'm trying to learn how to use structures, but they are a bit
confusing to me and the information I have obtained from google is not
helping too much. I would appreciate any example or link to a webpage
showing how to use structures. Thanks in advance!

Israel
Re: Name of arrays [message #79339 is a reply to message #79269] Mon, 20 February 2012 19:17 Go to previous messageGo to next message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
On Feb 20, 1:15 pm, Brian Wolven <brian.wol...@gmail.com> wrote:
> Or create_struct, using the month as the tag name, for pretty much any version of IDL.

+1.
Re: Name of arrays [message #79380 is a reply to message #79319] Thu, 23 February 2012 16:12 Go to previous message
Israel Rodriguez Herm is currently offline  Israel Rodriguez Herm
Messages: 13
Registered: February 2012
Junior Member
On Feb 21, 11:02 pm, Paulo Penteado <pp.pente...@gmail.com> wrote:
> On Feb 21, 6:36 pm, Israel Rodriguez Hermelo <israelherm...@gmail.com>
> wrote:
>
>> Would this code work? If the answer is yes, then I need to talk with
>> my boss about IDL v8 ;)
>
> Yes, it would work.
>
> As David said, you could do it with CM's hashtable. For IDL pre-8.0,
> it would be something like:
>
> MONTH=['MARCH','JULY']
>
> DAY=obj_new('hashtable')
> TEMPERATURE=bj_new('hashtable')
>
> Nmonth=N_ELEMENTS(MONTH)
>
> for i=0, Nmonth-1 do begin
>
>    readcol, 'DATA_'+MONTH(i)+'.txt', D, T
>
>    DAY->add,D
>    TEMPERATURE->add,T
>
> endfor
>
> plot, DAY->get(MONTH[0]), temperature->get(MONTH[0])
>   oplot, DAY->get(MONTH[1]), TEMPERATURE->get(MONTH[1])

Since I'm quite sure that I'll never get the demo version of IDL8 I've
tried with this solution. It works fine for me. Thanks a lot Paolo.

Regards,

Israel
Re: Name of arrays [message #79384 is a reply to message #79269] Thu, 23 February 2012 12:21 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Israel Rodriguez Hermelo writes:

> If that's is the only it takes to get password, here it's me on my
> last holidays:
>
> http://supercheng.tv/wiki/mankini-fat-i13.jpg

Now *that's* what I'm talking about! Coyote already has
it in a frame over his desk. :-)

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.")
Re: Name of arrays [message #79386 is a reply to message #79269] Thu, 23 February 2012 12:17 Go to previous message
Israel Rodriguez Herm is currently offline  Israel Rodriguez Herm
Messages: 13
Registered: February 2012
Junior Member
On Feb 23, 8:16 pm, David Fanning <n...@idlcoyote.com> wrote:

> Sorry, I'm always in too much hot water already. Coyote,
> though, has been known to give out his phone number, passwords,
> etc., indiscriminately if the request is submitted with
> a picture of the requester in a micro-bikini. (If you
> don't have a picture of you, one of your sister might work.)

If that's is the only it takes to get password, here it's me on my
last holidays:

http://supercheng.tv/wiki/mankini-fat-i13.jpg

hehe ok, I'll ask the permission to one of the "Representative
contacts"

Regards,

Israel
Re: Name of arrays [message #79387 is a reply to message #79269] Thu, 23 February 2012 11:16 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Israel Rodriguez Hermelo writes:

> Dear David, is that an invitation to use Wily Coyote? It would be
> great ;) If it is an invitation, might I ask what is the password?

Sorry, I'm always in too much hot water already. Coyote,
though, has been known to give out his phone number, passwords,
etc., indiscriminately if the request is submitted with
a picture of the requester in a micro-bikini. (If you
don't have a picture of you, one of your sister might work.)

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.")
Re: Name of arrays [message #79389 is a reply to message #79269] Thu, 23 February 2012 10:32 Go to previous message
Paul Van Delst[1] is currently offline  Paul Van Delst[1]
Messages: 1157
Registered: April 2002
Senior Member
If that username is taken, try: "Wile E. Coyote"

Without doubt the password should be: "beep beep"

:o)


Israel Rodriguez Hermelo wrote:
> On Feb 23, 6:30 pm, David Fanning <n...@idlcoyote.com> wrote:
>> Paulo Penteado writes:
>>> If you do not have an account, you need to create one. Or at least
>>> that is how it used to be.
>> You will have to provide a name for the account. Wily
>> Coyote has been used. Many times. :-)
>>
>> 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.")
>
> Yes, I have my account but anyway I've got acces denied.
>
> Dear David, is that an invitation to use Wily Coyote? It would be
> great ;) If it is an invitation, might I ask what is the password?
>
> Best regards,
>
> Israel
Re: Name of arrays [message #79390 is a reply to message #79269] Thu, 23 February 2012 10:14 Go to previous message
Israel Rodriguez Herm is currently offline  Israel Rodriguez Herm
Messages: 13
Registered: February 2012
Junior Member
On Feb 23, 6:30 pm, David Fanning <n...@idlcoyote.com> wrote:
> Paulo Penteado writes:
>> If you do not have an account, you need to create one. Or at least
>> that is how it used to be.
>
> You will have to provide a name for the account. Wily
> Coyote has been used. Many times. :-)
>
> 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.")

Yes, I have my account but anyway I've got acces denied.

Dear David, is that an invitation to use Wily Coyote? It would be
great ;) If it is an invitation, might I ask what is the password?

Best regards,

Israel
Re: Name of arrays [message #79392 is a reply to message #79269] Thu, 23 February 2012 09:30 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Paulo Penteado writes:

> If you do not have an account, you need to create one. Or at least
> that is how it used to be.

You will have to provide a name for the account. Wily
Coyote has been used. Many times. :-)

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.")
Re: Name of arrays [message #79393 is a reply to message #79269] Thu, 23 February 2012 09:19 Go to previous message
penteado is currently offline  penteado
Messages: 866
Registered: February 2018
Senior Member
Administrator
On Feb 23, 3:08 pm, Israel Rodriguez Hermelo <israelherm...@gmail.com>
wrote:
> I've got the message "Access Denied"... I guess I'll need to ask
> permission to one of the  "Representative contacts"... do I have any
> choice to get the permission? I red somewhere in this forum that I
> don't

If you do not have an account, you need to create one. Or at least
that is how it used to be.
Re: Name of arrays [message #79394 is a reply to message #79269] Thu, 23 February 2012 09:08 Go to previous message
Israel Rodriguez Herm is currently offline  Israel Rodriguez Herm
Messages: 13
Registered: February 2012
Junior Member
On Feb 23, 4:08 pm, Paulo Penteado <pp.pente...@gmail.com> wrote:
> On Feb 22, 8:04 am, Israel Rodriguez Hermelo <israelherm...@gmail.com>
> wrote:
>
>> I'm totally agree, a fancy interface for pointers is exactly what I
>> need!
>
>> I'm trying to download the demo version but I haven't found it. There
>> is not demo version anymore?
>
> The "Downloads" menu, on the front page ofhttp://www.exelisvis.com/
>
> Then you can follow the links throughhttp://www.exelisvis.com/Downloads/Download.aspx?prod uct=IDL

I've got the message "Access Denied"... I guess I'll need to ask
permission to one of the "Representative contacts"... do I have any
choice to get the permission? I red somewhere in this forum that I
don't

Thanks!

Israel
Re: Name of arrays [message #79397 is a reply to message #79310] Thu, 23 February 2012 07:08 Go to previous message
penteado is currently offline  penteado
Messages: 866
Registered: February 2018
Senior Member
Administrator
On Feb 22, 8:04 am, Israel Rodriguez Hermelo <israelherm...@gmail.com>
wrote:
> I'm totally agree, a fancy interface for pointers is exactly what I
> need!
>
> I'm trying to download the demo version but I haven't found it. There
> is not demo version anymore?

The "Downloads" menu, on the front page of http://www.exelisvis.com/

Then you can follow the links through http://www.exelisvis.com/Downloads/Download.aspx?product=IDL
Re: Name of arrays [message #84658 is a reply to message #79305] Thu, 23 February 2012 03:40 Go to previous message
Israel Rodriguez Herm is currently offline  Israel Rodriguez Herm
Messages: 13
Registered: February 2012
Junior Member
On Feb 22, 5:34 pm, David Fanning <n...@idlcoyote.com> wrote:
> Brian Wolven writes:
>> What? Is there no cg_rsi_search.pro, er, cg_ittvis_search.pro, um, I mean cg_excelis_search.pro?
>
> Some things are hopeless and can't be fixed (apparently). :-)
>
> 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.")

I give up, I can't find it :(
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: GRIB Webinar
Next Topic: Re: new graphics error message [_IDLITCONTAINER::SETPROPERTY]

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

Current Time: Wed Oct 08 15:16:56 PDT 2025

Total time taken to generate the page: 0.00639 seconds