-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgen_pub_figs.py
76 lines (57 loc) · 2.33 KB
/
gen_pub_figs.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#!/usr/bin/env python3
"""Generate all bar plots / correlation statistics for publication.
Example:
Once filepaths are set appropriately, run this function via
$ python gen_pub_figs.py
"""
import os
import pandas as pd
from multisensorimport.viz import plot_utils, print_utils, stats_utils
# directory containing all data (script path + relative string)
DATA_DIR = os.path.dirname(os.path.abspath(__file__)) + '/sandbox/data/FINAL/'
# paths to all precomputed subject data CSVs
DATA_DIR_SUB1 = DATA_DIR + 'sub1/wp5t11/'
DATA_DIR_SUB2 = DATA_DIR + 'sub2/wp5t28/'
DATA_DIR_SUB3 = DATA_DIR + 'sub3/wp5t33/'
DATA_DIR_SUB4 = DATA_DIR + 'sub4/wp5t34/'
DATA_DIR_SUB5 = DATA_DIR + 'sub5/wp5t37/'
def main():
"""Generate all aggregate plots reported in TNSRE 2021 publication."""
# generate angle correlation plot
df_ang = pd.read_csv(DATA_DIR + 'ang_corr.csv', header=0, index_col=0).T
print_utils.print_header('[SIGNAL]-FORCE CORRELATION ACROSS ANGLES (SUB1)')
print(df_ang)
plot_utils.gen_ang_plot(df_ang)
print_utils.print_div()
# generate subject correlation plot
df_subj = pd.read_csv(DATA_DIR + 'subj_corr.csv', header=0, index_col=0).T
print_utils.print_header(
'[SIGNAL]-FORCE CORRELATION ACROSS SUBJECTS (69deg)')
print(df_subj)
plot_utils.gen_subj_plot(df_subj)
print_utils.print_div()
# generate tracking accuracy plot
subj_dirs = [
DATA_DIR_SUB1, DATA_DIR_SUB2, DATA_DIR_SUB3, DATA_DIR_SUB4,
DATA_DIR_SUB5
]
df_means, df_stds, df_sems = stats_utils.gen_tracking_dfs(subj_dirs)
print_utils.print_header(
'TRACKING ERROR ACROSS SUBJECTS (JACCARD DISTANCE) - MEAN')
print(df_means)
print_utils.print_header(
'TRACKING ERROR ACROSS SUBJECTS (JACCARD DISTANCE) - STDDEV')
print(df_stds)
print_utils.print_header(
'TRACKING ERROR ACROSS SUBJECTS (JACCARD DISTANCE) - STDERR')
print(df_sems)
plot_utils.gen_tracking_error_plot(df_means, df_stds)
print_utils.print_div()
# generate example tracking data table
df_ex_means, df_ex_stds = stats_utils.gen_ex_tracking_df(DATA_DIR_SUB3)
print_utils.print_header('EXAMPLE TRACKING ERROR (SUB3) - MEAN')
print(df_ex_means)
print_utils.print_header('EXAMPLE TRACKING ERROR (SUB3) - STDDEV')
print(df_ex_stds)
if __name__ == "__main__":
main()