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

Home » Public Forums » archive » Re: find bimodal maximum in each row
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: find bimodal maximum in each row [message #74867] Sun, 06 February 2011 12:27 Go to previous message
Jeremy Bailin is currently offline  Jeremy Bailin
Messages: 618
Registered: April 2008
Senior Member
That's easily constructed from peakp:

q = [[0,1,2,1,2,1,0], [1,2,0,0,2,2,0], [0,2,2,2,0,1,0]]
nx = (size(q, /dimen))[0]
ny = (size(q, /dimen))[1]

; is this a local maximum? (note that the index starts at element 1,* of q)
peakp = (q[1:nx-2,*] gt q[2:nx-1,*]) and (q[0:nx-3,*] le q[1:nx-2,*])
; pad peakp to make it the same dimensions as q and multiply
peakonly = q * [replicate(0,1,ny), peakp, replicate(0,1,ny)]


IDL> print, peakonly
0 0 2 0 2 0 0
0 2 0 0 0 2 0
0 0 0 2 0 1 0


-Jeremy.
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Re: How to Find Bimodal peak values in an array
Next Topic: Re: Multiple Coyote Directories

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

Current Time: Wed Oct 08 19:13:35 PDT 2025

Total time taken to generate the page: 0.00469 seconds