Find local maximums in numpy array
<p>I am looking to find the peaks in some gaussian smoothed data that I have. I have looked at some of the peak detection methods available but they require an input range over which to search and I want this to be more automated than that. These methods are also designed for non-smoothed data. As my data is already smoothed I require a much more simple way of retrieving the peaks. My raw and smoothed data is in the graph below.</p>

<p><a href="https://i.stack.imgur.com/UwLNv.png" rel="noreferrer"><img src="https://i.stack.imgur.com/UwLNv.png" alt="enter image description here"></a></p>

<p>Essentially, is there a pythonic way of retrieving the max values from the array of smoothed data such that an array like</p>

<pre><code>    a = [1,2,3,4,5,4,3,2,1,2,3,2,1,2,3,4,5,6,5,4,3,2,1]
</code></pre>

<p>would return:</p>

<pre><code>    r = [5,3,6]
</code></pre>