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

Home » Public Forums » archive » arrays vs. functions conflicts
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
arrays vs. functions conflicts [message #38394] Fri, 05 March 2004 03:28 Go to next message
Paolo Grigis is currently offline  Paolo Grigis
Messages: 171
Registered: December 2003
Senior Member
Dear IDL experts,

since I was lucky enough to learn IDL after the []-brackets
revolution, the potential conflicts between arrays() and function()
calls never bothered me until I found out about it... then the
nightmares really started. ;-)

Thus my problem:
To resolve the conflict {that is, limits.pro being already
compiled and procedure.pro refusing to compile because it has
an old-fashioned statement like var=limits(1:2) instead of
var=limits[1:2]} I'm thinking of automatically compiling
the (hopefully) few troubling routines like procedure.pro
at startup using the resolve_routine() statement.
(BTW, why is the IDL compiler (5.5) not smart enough to
understand that function(1:2) is an array? ":" is never allowed
in function calls, after all.)

But before going on, I just wanted to know if there is an
easier way ouy of this that I have overlooked (and no, I
definitely do not want to override useful programs written
by others with my own []-version, only to start all over
again each time a new version or bug fix of the routine
comes out).

Greetings,
Paolo

DISCLAIMER: any IDL code, variable names and procedure statements
cited in this message are purely fictional and any resemblance to
real code, variable names and procedure statements, living or dead,
is coincidental.


____________________________________________________________ ________

Paolo Grigis
ETHZ - Institute of Astronomy email: pgrigis@astro.phys.ethz.ch
Scheuchzerstrasse 7
ETH Zentrum phone: ++41 1 632 42 20
8092 Zurich fax : ++41 1 632 12 05
Switzerland http://www.astro.phys.ethz.ch/
____________________________________________________________ ________
Re: arrays vs. functions conflicts [message #38448 is a reply to message #38394] Fri, 05 March 2004 15:45 Go to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
Paolo Grigis <pgrigis@astro.phys.ethz.ch> writes:
> Dear Craig,
>
> should you ever feel like giving up idl 4, I think you could be
> surprised how many people might volunteer to help you translating
> some code to []-notation!

Dear Paolo--

I admit that I don't use IDL 4 any more. *BUT*, my finger muscles
still know round parenthesis for IDL. It's not a habit I can easily
change.

The behavior you found is frustrating, because IDL should be smarter
than that. In fact, it *was* smarter in the past. IDL 4 and IDL 5.0
had no problems with your example, so there was something that RSI
changed in IDL 5.1 that dumb-ified IDL's recognition of arrays.

Note that even if I put these explicit statements in MPFIT:

limits = 0 & limits(0) = 0

before any other uses, so clearly IDL *should* know that LIMITS is a
variable in this context, IDL 5.1 and above fails to compile.

Truly unfortunate. I would consider changing to square bracket
notation, but it's hard to find time for such a mundane task. Knowing
that I did it right is another issue. I guess I'll try Wayne's
auto-converter at some point soon. And then I have to retrain my
fingers.

Craig

--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@REMOVEcow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
Re: arrays vs. functions conflicts [message #38452 is a reply to message #38394] Fri, 05 March 2004 11:34 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Bruce Bowler writes:

> IDL could *NOT* care less about. The way you wrote it IDL, since it could
> care less, must care some, and we know IDL doesn't give a rats arse...
>
> We now return you to your regularly scheduled discussion.
>
> end pet peeve alert

Yes, yes, yes. I'm working quickly today. :-)

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Re: arrays vs. functions conflicts [message #38464 is a reply to message #38394] Fri, 05 March 2004 08:57 Go to previous message
Paul Van Delst[1] is currently offline  Paul Van Delst[1]
Messages: 1157
Registered: April 2002
Senior Member
David Fanning wrote:
>
> Craig has his own problems (with users who don't like
> to upgrade their software all that often, one supposes).
> And I know for a fact that maintaining multiple versions
> of the same (free!!) library ain't gonna happen. :-)
>
> Cheers,
>
> David
>
> P.S. Let's just say I don't mind spending a few minutes
> adding a couple of square brackets for the kind of code
> I'm getting for free. :-)

I emphatically second that. Craig's MPFIT package allowed me to easily and quickly
create/test/refine a model to better estimate infrared sea surface emissivities. That
model (implemented in Fortran90) is now in use in the global forecast system here at EMC.
If those little improvements in estimating emissivities lead to better utilisation of
satellite data which may in turn lead to a more accurate forecast that will, potentially,
save lives -- then as far as I'm concerned, Craig can use whatever notation he wants! :o)


paulv

--
Paul van Delst
CIMSS @ NOAA/NCEP/EMC
Re: arrays vs. functions conflicts [message #38465 is a reply to message #38394] Fri, 05 March 2004 08:47 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Paolo Grigis writes:

> Dear Craig,
>
> should you ever feel like giving up idl 4, I think you could be
> surprised how many people might volunteer to help you translating
> some code to []-notation!

Oh, dear. Now I feel badly about dumping on poor Craig. I had
no idea it was *his* code you were using. It's just whenever
I run into this problem it is... well, never mind.

Craig has his own problems (with users who don't like
to upgrade their software all that often, one supposes).
And I know for a fact that maintaining multiple versions
of the same (free!!) library ain't gonna happen. :-)

Cheers,

David

P.S. Let's just say I don't mind spending a few minutes
adding a couple of square brackets for the kind of code
I'm getting for free. :-)

--
David Fanning, Ph.D.
Fanning Software Consulting
Coyote's Guide to IDL Programming: http://www.dfanning.com/
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: How to get info about ROI from iTools IIMage?
Next Topic: IDL JavaBridge on Mac OS X

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

Current Time: Wed Oct 08 17:44:53 PDT 2025

Total time taken to generate the page: 0.00608 seconds