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

Home » Public Forums » archive » Avoiding Loops in IDL 8.2.2
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Avoiding Loops in IDL 8.2.2 [message #85013] Fri, 21 June 2013 17:04 Go to previous message
Nate Tellis is currently offline  Nate Tellis
Messages: 2
Registered: June 2013
Junior Member
Hi all,

I have a series of 711x4096x3 arrays. I am searching for good fits to a model, which is an 11x19 array, using a reduced chi-square fit. As it is now, I step across, pixel by pixel, column by column, pane by pane, and perform the fit to a subimage centred at the loop indices (normalized to the value of the central pixel). The fit is simple element-wise subtraction and squaring of the sub images, followed by one call to 'total' on the sub-image:

Chi^2_red = 1/Npixels * Sum over each pixel((image - fit)^2/error^2)

(This is of course fast, as the -, ^2, /, and 'total' operations utilize the IDL thread pool)

I know I can speed this up by using operations that leverage multithreading. How can I go about avoiding these hated nested for loops? Performing the fits on all ~8,500,000 subimages without multithreading takes way too long - about 90 seconds on average.

Thank you for the help,
Nate
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: scattering data with MPFITFUN
Next Topic: how to manipulate data that are stored in memory directly?

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

Current Time: Wed Oct 08 15:08:14 PDT 2025

Total time taken to generate the page: 0.00421 seconds