-
Notifications
You must be signed in to change notification settings - Fork 0
/
param_spt_allfiles.py
41 lines (35 loc) · 1.17 KB
/
param_spt_allfiles.py
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
34
35
36
37
38
39
40
41
# -*- coding: utf-8 -*-
"""
Created on Thu Apr 05 15:50:02 2018
@author: AdminXPS
"""
import numpy as np
from param_spt import param_spt as param_spt
def param_spt_allfiles(filenames):
for ind_file, filename in enumerate(filenames):
filename_str = str(filename)
if ind_file == 0:
left = param_spt(filename_str, "left")
right = param_spt(filename_str, "right")
else:
left_temp = param_spt(filename_str, "left")
right_temp = param_spt(filename_str, "right")
for key in left:
left[key].extend(left_temp[key])
right[key].extend(right_temp[key])
left_mean = {}
right_mean = {}
left_std = {}
right_std = {}
for key in left:
left_mean[key] = np.mean(left[key])
left_std[key] = np.std(left[key])
right_mean[key] = np.mean(right[key])
right_std[key] = np.std(right[key])
left = {"mean": left_mean,
"std": left_std}
right = {"mean": right_mean,
"std": right_std}
subject_spt = {"left": left,
"right": right}
return subject_spt