rewriting getSpikes in numpy