-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfct_python.py
More file actions
33 lines (21 loc) · 931 Bytes
/
fct_python.py
File metadata and controls
33 lines (21 loc) · 931 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import numpy as np
#VITRO
general_path = 'F:\\data_vitro\\iter_21\\PULSE_0_75\\'
general_path = 'C:\\Users\\PM263553\\Desktop\\These\\big_projects\\monkey_mircen\\Manip_26__21_06_2023\\tof_all_channels\\'
data = np.load(general_path+'data.npy')
print(data.shape)
def alerte_absence_de_signal(array, seuil_still = 3000, seuil_noise = 3, n_noise = 10):
resultat = 1
for i in range(array.shape[0]):
mean, std, count = np.mean(array[i,:seuil_still]), np.std(array[i,:seuil_still]), 0
for j in range(seuil_still,array.shape[1]):
if array[i,j] > mean + seuil_noise*std:
count += 1
if count > n_noise:
resultat *=1
else:
resultat *=0
print('No signal on channel '+str(i+1))
if resultat == 1:
print('All channels are OK!!')
alerte_absence_de_signal(data, seuil_still = 3000, seuil_noise = 10, n_noise = 10)