@@ -17,7 +17,7 @@ from fractions import Fraction
17
17
# import yaml
18
18
# from sailing_robot.navigation import Navigation
19
19
20
- from LatLon import LatLon
20
+ # from LatLon import LatLon
21
21
from pyproj import Proj
22
22
import numpy as np
23
23
@@ -29,10 +29,10 @@ def latlon_to_utm(lat, lon):
29
29
"""Returns (x, y) coordinates in metres"""
30
30
return projection (lon , lat )
31
31
32
- def utm_to_latlon (x , y ):
33
- """Returns a LatLon object"""
34
- lon , lat = projection (x , y , inverse = True )
35
- return LatLon (lat , lon )
32
+ # def utm_to_latlon(x, y):
33
+ # """Returns a LatLon object"""
34
+ # lon, lat = projection(x, y, inverse=True)
35
+ # return LatLon(lat, lon)
36
36
37
37
38
38
@@ -95,7 +95,8 @@ vAB_orth = vAC
95
95
def generate_visit_set (filename ):
96
96
with open (filename ) as logfile :
97
97
data = csv .reader (logfile , delimiter = ',' )
98
- for row in list (data )[:1 ]:
98
+ position_utm = []
99
+ for row in list (data )[1 :]:
99
100
latitude = float (row [1 ])
100
101
longitude = float (row [2 ])
101
102
position_utm .append (latlon_to_utm (latitude , longitude ))
@@ -116,13 +117,6 @@ def generate_visit_set(filename):
116
117
return outputs
117
118
118
119
119
- def generate_weight (data ):
120
- weight_array = np .ones (subX , subY )
121
- for i in range (subX ):
122
- for j in range (subY ):
123
- for
124
-
125
-
126
120
127
121
CellVisitors = collections .namedtuple ('CellVisitors' , 'in_window out_of_window' )
128
122
@@ -132,7 +126,9 @@ CellVisitors = collections.namedtuple('CellVisitors', 'in_window out_of_window')
132
126
# boat_name
133
127
# in_window
134
128
master_data = pd .read_csv (sys .argv [1 ])
135
- master_data .visit_set = master_data .filename .apply (generate_visit_matrix )
129
+ master_data ['visit_set' ] = master_data .filename .apply (generate_visit_set )
130
+ for row in master_data .itertuples ():
131
+ print (row .filename , len (row .visit_set ))
136
132
137
133
# Build map of what teams visited which cells, in their in-window and out-of-window attempts
138
134
cell_visits = collections .defaultdict (lambda : CellVisitors (set (), set ()))
0 commit comments