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

Home » Public Forums » archive » Optimizing code for faster calculation
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: Optimizing code for faster calculation [message #88035 is a reply to message #88032] Thu, 13 March 2014 06:34 Go to previous messageGo to previous message
Heinz Stege is currently offline  Heinz Stege
Messages: 189
Registered: January 2003
Senior Member
On Wed, 12 Mar 2014 23:33:31 -0700 (PDT), Kenneth D wrote:

> Is there anything else I can do? That is, besides taking out iterations, they simply must be there to do what I need.

Since the array min_rmse has only 200 elements, I doubt that it is
possible to make this part of the code significantly faster.

Otherwise for me it seems, that "modeled_class" beeing a string array
is more the bottleneck than the where function. It may help to change
the code to something like the following. Start with the lines which
can be executed somewhere in the header of your code:

modeled_class=lonarr(200)
temp=["soil","quag","grass",...,"unmodeled"] ; unique values only!
modeled_class_names=temp[sort(temp)]
unmodeled=value_locate(modeled_class_names,"unmodeled")

Then write the respective indicees into the long integer array
modeled_class.

This way the lines whithin the iteration can be changed to

exceed_subs = where(min_rmse GT rmse_threshold, counter)
if counter GT 0 then modeled_class(exceed_subs) = unmodeled

Are such changes possible with your code?

Cheers, Heinz
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Difficulty using cgimage2kml for swath data plotted in a cylindrical (Map_set) projection
Next Topic: Force to print exponential to e-6

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

Current Time: Thu Oct 09 20:58:01 PDT 2025

Total time taken to generate the page: 1.68261 seconds