Mercurial > hg > nsaunier > traffic-intelligence
comparison scripts/safety-analysis.py @ 337:dc2e68e936c7
work in progress
| author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
|---|---|
| date | Sun, 16 Jun 2013 23:44:36 -0400 |
| parents | 3950bfe22768 |
| children | f3aceea2afbb |
comparison
equal
deleted
inserted
replaced
| 336:124f85c6cfae | 337:dc2e68e936c7 |
|---|---|
| 1 #! /usr/bin/env python | 1 #! /usr/bin/env python |
| 2 | 2 |
| 3 import sys,getopt | 3 import sys, argparse |
| 4 | 4 |
| 5 import matplotlib.pyplot as plt | 5 import matplotlib.pyplot as plt |
| 6 import numpy as np | 6 import numpy as np |
| 7 | 7 |
| 8 from ConfigParser import ConfigParser | 8 from ConfigParser import ConfigParser |
| 9 | 9 |
| 10 options, args = getopt.getopt(sys.argv[1:], 'hi:d:t:o:f:',['help']) | 10 parser = argparse.ArgumentParser(description='The program processes indicators for all pairs of road users in the scene') |
| 11 | 11 args = parser.parse_args() |
| 12 options = dict(options) | 12 print(args) |
| 13 | |
| 14 print options, args | |
| 15 | |
| 16 if '--help' in options.keys() or '-h' in options.keys() or len(sys.argv) == 1: | |
| 17 print('Usage: '+sys.argv[0]+' --help|-h config_file.cfg\n' | |
| 18 'The program processes indicators for all pairs of road users in the scene\n\n' | |
| 19 'Order matters between positional and named arguments') | |
| 20 sys.exit() | |
| 21 | |
| 22 # TODO work on the way to indicate an interaction definition | 13 # TODO work on the way to indicate an interaction definition |
| 23 | 14 |
| 24 if len(args)>0: # consider there is a configuration file | 15 if False:#len(args)>0: # consider there is a configuration file |
| 25 params = utils.TrackingParameters() | 16 params = utils.TrackingParameters() |
| 26 params.loadConfigFile(args[0]) | 17 params.loadConfigFile(args[0]) |
| 27 | 18 |
| 28 | 19 |
| 29 | 20 |
