Skip to content

Commit c56467d

Browse files
committed
scoring for area scanning
1 parent a7dc656 commit c56467d

File tree

2 files changed

+10
-161
lines changed

2 files changed

+10
-161
lines changed

AreaScanning/analyse_area_scanning

Lines changed: 0 additions & 147 deletions
This file was deleted.

area-scanning/analyse_area_scanning

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ from fractions import Fraction
1717
# import yaml
1818
# from sailing_robot.navigation import Navigation
1919

20-
from LatLon import LatLon
20+
# from LatLon import LatLon
2121
from pyproj import Proj
2222
import numpy as np
2323

@@ -29,10 +29,10 @@ def latlon_to_utm(lat, lon):
2929
"""Returns (x, y) coordinates in metres"""
3030
return projection(lon, lat)
3131

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)
3636

3737

3838

@@ -95,7 +95,8 @@ vAB_orth = vAC
9595
def generate_visit_set(filename):
9696
with open(filename) as logfile:
9797
data = csv.reader(logfile, delimiter=',')
98-
for row in list(data)[:1]:
98+
position_utm = []
99+
for row in list(data)[1:]:
99100
latitude = float(row[1])
100101
longitude = float(row[2])
101102
position_utm.append(latlon_to_utm(latitude, longitude))
@@ -116,13 +117,6 @@ def generate_visit_set(filename):
116117
return outputs
117118

118119

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-
126120

127121
CellVisitors = collections.namedtuple('CellVisitors', 'in_window out_of_window')
128122

@@ -132,7 +126,9 @@ CellVisitors = collections.namedtuple('CellVisitors', 'in_window out_of_window')
132126
# boat_name
133127
# in_window
134128
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))
136132

137133
# Build map of what teams visited which cells, in their in-window and out-of-window attempts
138134
cell_visits = collections.defaultdict(lambda: CellVisitors(set(), set()))

0 commit comments

Comments
 (0)