surajmandalcell / libigc

A library for parsing IGC files and extracting thermals
MIT License
2 stars 0 forks source link

bearing_change_rate calculation error #1

Open N00BMmika opened 1 week ago

N00BMmika commented 1 week ago

Hello,

Thank you for maintaining this library. I started to analyze my flight with it and wanted to inspect turn speed during thermalling. I think that there is some error on bearing_change_rate calculation.

With the below test code there are jumps in the bearing_change_rate even tough it should be quite constant when thermalling.

bearing_change_rate



# file from https://www.xcontest.org/world/en/flights/detail:mikamika/9.11.2024/11:57
f='2024-11-09-XCT-MLA-05.igc'

# Parse an IGC file
flight = Flight.create_from_file(f)

bearing_change_rate = []
bearing = []
# Access individual fixes
alt = []
for fix in flight.fixes[2850:2900]:
    bearing_change_rate.append(fix.bearing_change_rate)
    alt.append(fix.alt)
    bearing.append(fix.bearing)

import pylab
pylab.plot(bearing_change_rate,'-*')
pylab.plot(bearing,'-x')
pylab.legend(['bearing_change_rate','bearing'])
#pylab.plot(alt)
pylab.show()
surajmandalcell commented 1 week ago

Hi, Thank you for raising the issue. I'll take a look at it next week. If you find a solution along the way, feel free to raise a PR.