[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Avoiding a for cicle

> Alright code slingers... new challenge... find location of all peaks in a region
> of n points (n odd), monotonically decreasing away from the peak.  I.e. find
> peaks of width n.

Since noone will take my challenge I'm forced to claim the prize for myself:

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


 J.D. Smith                             |*|      WORK: (607) 255-5842    
 Cornell University Dept. of Astronomy  |*|            (607) 255-6263
 304 Space Sciences Bldg.               |*|       FAX: (607) 255-5875 
 Ithaca, NY 14853                       |*|