Skip to content

Commit

Permalink
temporary fixes for uvalde wgc; need to figure out where permanent fi…
Browse files Browse the repository at this point in the history
…xes land
  • Loading branch information
GliderGeek committed Aug 25, 2024
1 parent bb088bd commit 0aba3b0
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 15 deletions.
38 changes: 26 additions & 12 deletions PySoar/analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from opensoar.competition.soaringspot import SoaringSpotDaily

from exportClass import ExcelExport
from opensoar.utilities.geojson_serializers import generate_geojson, task_to_geojson_features, trip_to_geojson_features, trace_to_geojson_features
from performanceClass import Performance
from settingsClass import Settings

Expand Down Expand Up @@ -78,20 +79,33 @@ def run(self):

for competitor in competition_day.competitors:

print('comp id:', competitor.competition_id)

if competitor.competition_id in failed_comp_ids:
continue
print('failed_comp_id:', failed_comp_ids)
else:
try:
# put gps_altitude to False when nonzero pressure altitude is found
gps_altitude = True
for fix in competitor.trace:
if fix['pressure_alt'] != 0:
gps_altitude = False

competitor.performance = Performance(competition_day.task, competitor.trip, competitor.phases,
gps_altitude)
except Exception:
failed_comp_ids.append(competitor.competition_id)

import json
if competitor.competition_id == 'MG':
features = [
*task_to_geojson_features(competition_day.task),
*trip_to_geojson_features(competitor.trip, "#062123"),
*trace_to_geojson_features(competitor.trace),

]
geojson_dct = generate_geojson(features)
with open('debug.json', 'w') as f:
json.dump(geojson_dct, f)
print('successfully dumped json')

# put gps_altitude to False when nonzero pressure altitude is found
gps_altitude = True
for fix in competitor.trace:
if fix['pressure_alt'] != 0:
gps_altitude = False

competitor.performance = Performance(competition_day.task, competitor.trip, competitor.phases,
gps_altitude)

failed_competitors = []
for competitor in competition_day.competitors:
Expand Down
6 changes: 3 additions & 3 deletions PySoar/exportClass.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,9 +263,9 @@ def write_perf_indics(self, leg, settings, competition_day):

if perf_ind in ['t_start', 't_finish']:

timezone = competition_day.task.timezone
if timezone is not None:
content = add_times(content, datetime.timedelta(hours=timezone))
# timezone = competition_day.task.timezone
# if timezone is not None:
# content = add_times(content, datetime.timedelta(hours=timezone))

content = content.strftime('%H:%M:%S')

Expand Down

0 comments on commit 0aba3b0

Please sign in to comment.