Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove duplicate time entries from trace #51

Open
wants to merge 2 commits into
base: development
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions opensoar/competition/soaringspot.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
from opensoar.task.waypoint import Waypoint
from opensoar.utilities.helper_functions import dm2dd, subtract_times
from opensoar.competition.daily_results_page import DailyResultsPage
from opensoar.utilities.helper_functions import double_iterator
from opensoar.utilities.helper_functions import seconds_time_difference


def get_comment_lines_from_parsed_file(parsed_igc_file: dict) -> List[str]:
Expand Down Expand Up @@ -358,6 +360,11 @@ def generate_competition_day(self, target_directory: str, download_progress=None
print('{} is skipped because of invalid trace'.format(competition_id))
continue

# Remove double time entries. Remove the latest one if double entries exist
for index_to_check, index_base in double_iterator(range(len(trace) - 1, -1, -1)):
if abs(seconds_time_difference(trace[index_to_check]["time"], trace[index_base]["time"])) < 1e-1:
trace.pop(index_to_check)

# get info from file
task, contest_information, competitor_information = get_info_from_comment_lines(parsed_igc_file, start_time_buffer)
plane_model = competitor_information.get('plane_model', None)
Expand Down