So now I'm rewriting my latest spikefinder.

It's tedious.
I have remade it

It should now work correctly.  I made 'thresh' this time to be the
threshold, and it's simply outside of the loop.