Repository navigation
Trim each flight to the airborne portion and segment it into legs #229
Copy link
Copy link
Open
Labels
area:mlML / inference workML / inference workenhancementNew feature or requestNew feature or requestpython
Milestone
Description
Blocked by: #228
Is your feature request related to a problem? Please describe.
About 70% of every file is the aircraft sitting on the ground, before and after the flight (roughly 60 min idle, then 24–32 min of flying). Computing deviation over the whole file measures idle time, not flying. A whole-flight standard deviation also mixes a climb, level legs, turns and a descent, which is not comparable to a level-flight target.
Every pilot flew the same route, which visits three airports (airport names are inferred from coordinates and elevation, not confirmed by the client):
- Depart runway 18 at the departure field (about 1,100 ft; likely Johnson County Executive).
- Climb on 190° to about 3,100 ft.
- Descend on 220° to an intermediate airport (about 943 ft; likely Miami County, runway 21) for a touch-and-go, low approach or go-around. One flight makes a full stop of about 4 minutes there before taking off again.
- Climb out on 040° back to about 3,100 ft.
- Descend on 000° and land on runway 36 at a third airport (about 1,091 ft; likely New Century), about 7 nm from the departure field.
So the 220° and 000° legs are approaches, not descents at altitude.
Describe the solution you'd like
- Trimming: cut each flight from the first takeoff roll to the final touchdown, using IAS above a threshold together with altitude above the field. The flight touches down mid-route at the intermediate airport, so trimming must not stop at the first touchdown. The three fields sit at different elevations (about 1,100, 943 and 1,091 ft), so "above the field" needs the elevation of the nearest field, not one constant. Make the thresholds constants and report the trimmed duration per flight.
- Gaps: flag any Δt above 3 s and record the count per flight. Do not interpolate. Known gaps: P001_T1 (one gap, about 44 s) and P004_T1 (five gaps over 3 s, the largest 12 s).
- Leg segmentation: label each sample with a phase. Proposed phases are
takeoff_climb,leg_190,approach_220,intermediate_airport(touch-and-go, low approach, go-around or full stop),climb_040andapproach_landing_000. Which of these get targets, and how an approach is scored, depends on the client's answer to Capture designated (target) values for altitude, heading, vertical speed and airspeed #213. Detect them from a heading bin held for at least N seconds plus the transitions between bins. Keep the method rule-based and documented. All 19 flights follow the same sequence, so a flight with a missing or extra leg should produce a warning. - Output: add a
phasecolumn to the telemetry table, plus a per-flight summary with each leg's start, end and duration.
Acceptance criteria
- Every flight's trimmed duration falls between 20 and 35 min, or the flight is listed as an exception with a reason (P004_T1 is a likely exception: it is only 33 min in total)
- A plot of altitude and heading against time, coloured by phase, for every flight, saved to
inference/Results/(gitignored) - Tests run on a hand-built flight with a known leg sequence
Metadata
Metadata
Assignees
Labels
area:mlML / inference workML / inference workenhancementNew feature or requestNew feature or requestpython
Activity
jmacd867 commentedon Oct 15, 2026
Edited the body. The route visits three airports, not one: the 220° leg is an approach to an intermediate airport (touch-and-go, low approach, go-around, or in one flight a full stop of about 4 min), and the 000° leg is an approach to a third airport about 7 nm from the departure field. That changes trimming (stop at the final touchdown, not the first; use the nearest field's elevation, since the fields sit at about 1,100, 943 and 1,091 ft) and the proposed phases. Also corrected the known gaps: P004_T1 has five gaps over 3 s, not one.
jmacd867 commentedon Oct 16, 2026
Answers from the client meeting (`docs/client_meeting_notes.md`):