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

Home » Public Forums » archive » Dos and Donts
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
Dos and Donts [message #21923] Wed, 27 September 2000 00:00 Go to next message
Hans J�rg Brinksmey is currently offline  Hans J�rg Brinksmey
Messages: 4
Registered: December 1998
Junior Member
Hi there!

I'm preparing a little talk about efficient programming in IDL. From the
help files and from my own experience I found many hints about 'what to
do and not to do' to speed up code in IDL. The most things I listed so
far are about array operations and data arrangement, avoiding loops etc.
Taking an intensive look into the help system I found some little tricks
to improve speed, e.g. using rotation for image rotation by 90 deg
rather than rot(...,90). Up to now I didn't know that there is a
difference at all.

I am sure there are many more odds and ends to improve IDL code. Does
anyone out there can give my a hint where to find more of those tricks?
Links, recommendation of a book, or just some direct tips would be very
helpfull.

Thank you an advance and best greetings from Marburg,
Hans Joerg Brinksmeyer


--
H.J.Brinksmeyer - Physics Department
University of Marburg, Germany
Re: Dos and Donts [message #21963 is a reply to message #21923] Tue, 03 October 2000 00:00 Go to previous message
pit is currently offline  pit
Messages: 92
Registered: January 1996
Member
brinks <h.j.brinksmeyer@physik.uni-marburg.de> writes:

>> The argument a[0:63, 0:63] is passed to TEMPORARY by value, and
>> therefore cannot be modified. However the following method *does* save
>> memory:
>>
>> a = dist(256)
>> b = (temporary(a))[0:63, 0:63]
>> help, a, b
>> A UNDEFINED = <Undefined>
>> B FLOAT = Array[64, 64]
>
> Finally, that's something new, I didn't know before!!!
> Thank you very much :-)

But exactly as one should expect.

Concerning temporary:
Be carefull in tight memory situations.
If you *do* run out of memory in a
a = f(temporary(a))
statement, then a is lost as in the example above!

Peter

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~
Dr. Peter "Pit" Suetterlin http://www.astro.uu.nl/~suetter
Sterrenkundig Instituut Utrecht
Tel.: +31 (0)30 253 5225 P.Suetterlin@astro.uu.nl
____________________________________________________________ ______________
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Complex data type
Next Topic: Kodak & RSI FAQ

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

Current Time: Wed Oct 08 18:41:31 PDT 2025

Total time taken to generate the page: 0.00620 seconds