-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy patheval-nemesyspca-refine.sh
110 lines (91 loc) · 2.97 KB
/
eval-nemesyspca-refine.sh
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
#!/usr/bin/env bash
#input=input/*-100.pcap
#input=input/*-1000.pcap
#input="input/*-100.pcap input/*-1000.pcap"
# input=input/maxdiff-fromOrig/*-100.pcap
input=input/maxdiff-fromOrig/*-100*.pcap
# full
#sigmas="0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0 2.1 2.2 2.3"
# default
#sigmas="1.2"
sigmas="0.9 1.2"
#sigmas="0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.2"
# full
# "original" is the WOOT refinement
#refines="base original nemetyl PCA PCA1 PCAmoco zerocharPCAmoco zerocharPCAmocoSF"
# default
#refines="original nemetyl zerocharPCAmocoSF emzcPCAmocoSF"
refines="original"
L1PROTOS="input/ari_*"
L2PROTOS="input/awdl-* input/au-* input/wlan-beacons-*"
# for reference see nemesys-le-compare.ods
LEPROTOS="input/awdl-* input/au-* input/smb* input/*/smb* input/wlan-beacons-*"
prefix="nemesys"
cftnpad="250"
for f in reports/${prefix}-* ; do
if [ -e "$f" ] ; then
cftnext=$(expr 1 + $(ls -d reports/${prefix}-* | sed "s/^.*${prefix}-\([0-9]*\)-.*$/\1/" | sort | tail -1))
cftnpad=$(printf "%03d" ${cftnext})
fi
break
done
currcomm=$(git log -1 --format="%h")
report=reports/${prefix}-${cftnpad}-refinement-${currcomm}
mkdir ${report}
for ref in ${refines} ; do
for sig in ${sigmas} ; do
pids=()
for fn in ${input} ; do
optargs="-r" # with plots add: -p
for proto in ${L2PROTOS} ; do
if [[ "${fn}" == ${proto} ]] ; then
# replace
optargs="-l 2"
fi
done
for proto in ${L1PROTOS} ; do
if [[ "${fn}" == ${proto} ]] ; then
# replace
optargs="-l 1"
fi
done
for proto in ${LEPROTOS} ; do
if [[ "${fn}" == $proto ]] ; then
# echo "Compare with and without little endian optimization"
# then append
optargs="${optargs} -e" # -e: little endian
fi
done
bn=$(basename -- ${fn})
strippedname="${bn%.*}"
python src/nemesys_pca-refinement.py -s ${sig} ${optargs} -f ${ref} ${fn} >> "${report}/${strippedname}.log" &
pids+=( $! )
# Compare with and without little endian optimization
#python src/nemesys_pca-refinement.py -s ${sig} ${optargs} -e -f ${ref} ${fn}
# dynamic sigma
#python src/nemesys_pca-refinement.py -f ${ref} -r ${fn}
done
for pid in "${pids[@]}"; do
printf 'Waiting for %d...' "$pid"
wait $pid
echo 'done.'
done
done
done
# copy all lines of the "ScoreStatistics.csv" files together into one per trace
mv reports/*.pdf ${report}/
for fn in ${input};
do
bn=$(basename -- ${fn})
strippedname="${bn%.*}"
mv reports/${strippedname} ${report}/
done
# combine PCA refinement condition statistics into a single "...-combined.csv"
cd ${report}/
ln -s ../combine-stats.sh .
./combine-stats.sh
cd -
# combine all ScoreStatistics into one file with a sheet for each trace in a xls file
python reports/combine-nemesys-fms.py ${report}/
echo "Report written to folder ${report}"
spd-say "Bin fertig!"