changeset 1068:e6b791ad7f85

minor
author Nicolas Saunier <nicolas.saunier@polymtl.ca>
date Mon, 16 Jul 2018 22:53:11 -0400
parents 092bd9c7deaf
children 9ee5c7636640
files scripts/process.py
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/process.py	Mon Jul 16 01:24:26 2018 -0400
+++ b/scripts/process.py	Mon Jul 16 22:53:11 2018 -0400
@@ -248,6 +248,9 @@
 if args.analyze == 'object':
     # user speeds, accelerations
     # aggregation per site
+    if args.eventFilename is None:
+        print('Missing output filename (event-filename). Exiting')
+        sys.exit(0)
     data = [] # list of observation per site-user with time
     headers = ['site', 'date', 'time', 'user_type']
     aggFunctions, tmpheaders = utils.aggregationMethods(args.aggMethods, args.aggCentiles)
@@ -260,12 +263,11 @@
         for job in jobs:
             data.extend(job.get())
         pool.close()
-            
     data = pd.DataFrame(data, columns = headers)
     if args.output == 'figure':
         for name in headers[4:]:
             plt.ioff()
-            plt.figure() # siteids does not exist
+            plt.figure()
             plt.boxplot([data.loc[data['site']==site.name, name] for site in sites], labels = [site.name for site in sites])
             plt.ylabel(name+' Speeds (km/h)')
             plt.savefig(name.lower()+'-speeds.png', dpi=dpi)