FAI-CIVL / FAI-Airscore

AirScore - online paragliding / hanggliding GAP-based scoring software.
https://airscore.cc/
GNU General Public License v3.0
12 stars 17 forks source link

truncate tracklogs at window open #294

Open kuaka opened 2 years ago

kuaka commented 2 years ago

There is an issue with trackers that are turned on before traveling to takeoff and pilots being given 0km. This is probably due to the flight detection algorithm (which will take the 1st 'flight' in a track log) being triggered by the height gain or ground speed of going to takeoff. A sensible solution is probably to ignore/remove track log points before window open before running flight detection.

biuti commented 2 years ago

In the library we are using (igc_lib) create_from_file method seems to be able to process only first flight, or all the remaining part of the track, so we would need to process the track file before creating the Flight object.

I created a method Track.process() that should do exactly what we need. Have a look please, I tested it and it seems to work.

kuaka commented 2 years ago

looks like you have wrapped igc_lib in track.process which seems reasonable. What happens if someone submits a track that has no points inside the time window (maybe by accident) will it remove all fixes and what is the behavior of the application? (will it crash or give back useful feedback?). If it doesn't handle it well it might be easiest to use the original track - i.e. if no fixes in time window then pass non trimmed igc to igc_lib.