-
Notifications
You must be signed in to change notification settings - Fork 2
/
angleClusterCal.py
45 lines (34 loc) · 1007 Bytes
/
angleClusterCal.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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# angleCluster 计算
import sys
import time
import logging
from util.tripFlow.AngleClusterInOneGrid import AngleClusterInOneGrid
def processTask(x, stdindir, stdoutdir, eps, min_samples):
PROP = {
'index': x,
'IDIRECTORY': stdindir,
'ODIRECTORY': stdoutdir,
'eps': eps,
'min_samples': min_samples
}
task = AngleClusterInOneGrid(PROP)
task.run()
def usage():
print "python angleClusterCal.py /datahouse/tripflow/200 /datahouse/tripflow/200 9 0.01 100"
def main(argv):
[indir, outdir, x, eps, min_samples] = argv
x = int(x)
eps = float(eps)
min_samples = int(min_samples)
STARTTIME = time.time()
print "Start approach at %s" % STARTTIME
processTask(x, indir, outdir, eps, min_samples)
ENDTIME = time.time()
print "END TIME: %s" % ENDTIME
print "Total minutes: %f" % ((ENDTIME-STARTTIME)/60.0)
if __name__ == '__main__':
logging.basicConfig(filename='logger-angleclustercal.log', level=logging.DEBUG)
main(sys.argv[1:])