Simple spike extraction script in python