igc_lib
igc_lib copied to clipboard
Thermal properties
Hi Marcin, looks very promising. To be truly useful though the following information would be necessary:
- thermal entry height
- thermal exit height
- (average) thermal strength
- time spent in thermal (can be calculated from current data, still nice)
- optionally some wind/drift information
Maybe this is all doable with your library, if so please could you provide some instructions? Thanks.
Hi,
the first 4 things on the list are there in the library. After you parse an IGC flight and get a Thermal object you can query it like this:
ipdb> flight
<igc_lib.Flight instance at 0x1011336c8>
ipdb> flight.thermals[0]
Thermal(vertical_velocity=1.61 m/s, duration=7m 8s)
ipdb> flight.thermals[0].enter_fix.alt
537.0
ipdb> flight.thermals[0].exit_fix.alt
1224.0
ipdb> flight.thermals[0].vertical_velocity()
1.605140186915888
ipdb> flight.thermals[0].time_change()
428.0
See the Flight::create_from_file() function on how to create a Flight object, and the Thermal class in igc_lib.py.
As far as wind/drift calculation goes, it's not currently there, but a basic version: (exit_position - entry_position)/(exit_time - entry_time) should be pretty easy to implement. Let me know if you'd need that, I can have a look into it. Also, I'm happy to accept pull requests here :)
Great, thank you! Looked through the code and it's very readable. Will look into the wind drift topic, shouldn't be that hard to implement.
Sure, if you get some time for it and get it working I'll be happy to review a pull request with an extra feature - sounds useful to have.