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

Home » Public Forums » archive » Re: How to speed up code which checks lots of values of an array
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: How to speed up code which checks lots of values of an array [message #74363 is a reply to message #74332] Thu, 13 January 2011 08:43 Go to previous messageGo to previous message
Robin Wilson is currently offline  Robin Wilson
Messages: 40
Registered: August 2010
Member
>
> IF(MAX(line[0:section_len - 1]) LE 180) AND (MIN(line[section_len + 1:
> len - 1]) GE 180) THEN
> ; Do stuff
> ENDIF

Thanks for the idea. That increases the speed a bit - the overall time
decreases by about a second.

I guess I've made that bit as fast a possible, and I need to deal with
the other speed issues with the code...like the fact that the code above
is being run inside a FOR loop, which is not the 'IDL way'.

So, does anyone have any idea how the following could be implemented
without my FOR loop. I'll describe it in words first, and post code
later if people need it:

For each pixel in the image (so, nested FOR loops going over the rows
and the columns):
Get a single 1D line centered on the pixel in question (the length is
configurable, so it could be a 5 pixel long line, or a 100 pixel long line)
Run the code in the last post on the line
Loop

At the moment I am using a function to extract the X pixel long line
from the image. I have a suspicion that this could be done using CONVOL,
but I can't see how...Any ideas?

Cheers,

Robin
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: IDL 8.0 plot lat/lon data into map
Next Topic: Columnist Talking About Newsgroup

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

Current Time: Fri Oct 10 13:00:09 PDT 2025

Total time taken to generate the page: 0.95829 seconds