-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserial_analysis.py
55 lines (41 loc) · 1.26 KB
/
serial_analysis.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
#log1 = open('~/Desktop/GPSlog.txt', 'wr')
#log2 = open('~/Desktop/REClog.txt', 'wr')
#log3 = open('~/Desktop/GYROlog.txt', 'wr')
minTime = 8000
maxTime = 1
timeCount = 0
sensorCount1 = 0
sensorCount2 = 0
sensorCount3 = 0
sensorCount4 = 0
with open('timelog.txt', 'r+b') as f:
for line in f:
timeCount = timeCount + 1
if int(line) <minTime and timeCount > 50:
minTime = int(line)
elif int(line) > maxTime and timeCount > 50:
maxTime = int(line)
print ('Maximum Delay Between Data was: ')
print maxTime
print ('Minimum Delay Between Data was: ')
print minTime
with open('ANElog.txt', 'r+b') as f:
for line in f:
sensorCount4 = sensorCount4 + 1
print ('Numbers of lines missing from ANE: ')
print (timeCount - sensorCount4)
with open('GYROlog.txt', 'r+b') as f:
for line in f:
sensorCount4 = sensorCount3 + 1
print ('Numbers of lines missing from GYRO: ')
print (timeCount - sensorCount3)
with open('GPSlog.txt', 'r+b') as f:
for line in f:
sensorCount2 = sensorCount2 + 1
print ('Numbers of lines missing from GPS: ')
print (timeCount - sensorCount2)
with open('REClog.txt', 'r+b') as f:
for line in f:
sensorCount1 = sensorCount1 + 1
print ('Numbers of lines missing from REC: ')
print (timeCount - sensorCount1)