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

Home » Public Forums » archive » How to speed up or remove this FOR loop
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
How to speed up or remove this FOR loop [message #74453] Fri, 14 January 2011 01:00 Go to previous message
johan[1] is currently offline  johan[1]
Messages: 11
Registered: December 2010
Junior Member
I do have 768 profiles, each 24 pixels long, each to whom I want to
fit a Gaussain and getting the mean and SD. I am using the following
FOR loop calling mpfitexpr. It works fine but it takes forever to
complete!

expr = 'P[0] + GAUSS1(X, P[1:3])'

t = indgen(24)
start = [20.D, 10, 2., 1000.]

for i=0,(size(profiles,/dim))[1]-1 do begin
r = profiles[*,i]
result = mpfitexpr(expr, t, r, 1, start, /QUIET)
endfor

Anyway to speed it up or to remove the FOR loop?
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Re: Need help with map projection conversion in ENVI
Next Topic: Re: Coyote's BIG Idea

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

Current Time: Wed Oct 08 17:15:25 PDT 2025

Total time taken to generate the page: 0.00461 seconds