NTRT Simulator  Version: Master
 All Classes Namespaces Files Functions Variables Typedefs Friends Pages
cutOutliers.py
1 """ Filter out trials from argv[1] that have 'traveled' more than threshold """
2 
3 import sys
4 
5 bestDistances = []
6 threshold = 80.0 # Score (distance traveled)
7 
8 try:
9  f = open(sys.argv[1], 'r')
10  for line in f:
11  if (float(line.partition(',')[0]) < threshold):
12  bestDistances.append(line)
13 finally:
14  f.close()
15 
16 for p in bestDistances: sys.stdout.write(p)
17