Advertisement
MagicWinnie

Untitled

Dec 5th, 2018
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.71 KB | None | 0 0
  1. import matplotlib as mpl
  2. import numpy as np
  3. from scipy import signal
  4. array = list(map(float, input().split(" ")))
  5. max_skip=int(500*60/200)
  6. sredn=30
  7. amplituda=0.3
  8. i=0
  9. abc=[]
  10. leng=len(array)
  11. while i<leng:
  12.     pod_arr=array[i:min(i+sredn, leng)]
  13.     block=len(pod_arr)//3
  14.     one,two,three = pod_arr[:block], pod_arr[block:block*2], pod_arr[block*2:]
  15.     if len(one)==0 or len(two)==0 or len(three)==0:
  16.         break
  17.     min_1=min(one)
  18.     max_2=max(two)
  19.     max_2_ind=two.index(max_2) + block
  20.     min_3=min(three)
  21.     min_3_ind=three.index(min_3) + block * 2
  22.     if max_2-min_1 > amplituda and max_2 - min_3 > amplituda:
  23.         abc.append(i+max_2_ind)
  24.         i+=min_3_ind + max_skip
  25.     else:
  26.         i+=1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement