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

Home » Public Forums » archive » Another "How to efficiently do this in IDL" question
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: Another "How to efficiently do this in IDL" question [message #78304 is a reply to message #78105] Thu, 03 November 2011 14:56 Go to previous message
JDS is currently offline  JDS
Messages: 94
Registered: March 2009
Member
On Friday, October 21, 2011 6:15:09 PM UTC-4, robintw wrote:
>
> The other main question is that if I've got an array of points like the
> following:
>
> 1 3 3 5 6 2 1
> *
>
> What is an efficient way to check that there are at least two points on
> each side of the central point (marked with a star) that have a lower
> value than it. My original thought was to loop through the cells, but I
> suspect some fancy histogram command could do something to help with this...
>

You can find all the "5 point peaks" relatively efficiently:

wh=where(d gt ((m=median(d,3))) and smooth((d eq m)*(n-2),n-2) eq n-3)

n=5 in your case.
[Message index]
 
Read Message
Read Message
Previous Topic: Pixel modification after classification
Next Topic: Re: UTM Map Projection Produces Incorrect Results

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

Current Time: Fri Oct 10 17:08:44 PDT 2025

Total time taken to generate the page: 1.04017 seconds