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 #88036 is a reply to message #88035] Thu, 13 March 2014 06:46 Go to previous messageGo to previous message
chris_torrence@NOSPAM is currently offline  chris_torrence@NOSPAM
Messages: 528
Registered: March 2007
Senior Member
> 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

I would agree with Heinz. Strings in general are slow. Heck, if you only have 200, I would just use a byte array for the modeled_class index values. You can then convert them at the very end (outside of the loop!) to the string values.

Also, not sure what version of IDL you're using (I'm a bit worried that you are using parentheses for indexing, which is never a good sign...), but if you have IDL 8.0 or higher, you could eliminate the "if counter" check by using the NULL keyword to where:

modeled_class[WHERE(min_rmse gt rmse_threshold, /NULL)] = unmodeled

This will be a "no-op" if none of the values match, and will do the right thing if some of the values match.

Cheers,
Chris
ExelisVIS
[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: Wed Oct 08 20:00:04 PDT 2025

Total time taken to generate the page: 0.00176 seconds