Skip to content

Trim each flight to the airborne portion and segment it into legs #229

Open

Description

@Sanjana-Siddani

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):

  1. Depart runway 18 at the departure field (about 1,100 ft; likely Johnson County Executive).
  2. Climb on 190° to about 3,100 ft.
  3. 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.
  4. Climb out on 040° back to about 3,100 ft.
  5. 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_040 and approach_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 phase column 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

Activity

  1. jmacd867 commented on Oct 15, 2026

    @jmacd867
    Collaborator

    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.

  2. jmacd867 commented on Oct 16, 2026

    @jmacd867
    Collaborator

    Answers from the client meeting (`docs/client_meeting_notes.md`):

    • Trimming is right: time on the ground does not matter. Measure from takeoff to the final landing and leave the ground time out.
    • Stopped recordings: stopping and restarting a recording partway through a flight is still one flight. Join the parts by timestamp (see the new issue for merging).
    • Segmentation: the client already segmented each flight into 7 phases of flight and will share it. Use it as ground truth to check the rule-based legs, or as the source of legs while we have no instruction timestamps. The 7 phases may not match the 6 proposed here, so compare before settling the phase names.
    • Scoring approaches: the client said all four factors apply to every leg, including the approaches (220 and 000), so no separate glide-path scoring is needed for now.
    • Climbs on 190 and 040 target 3,100 ft.
  3. added this to the v1.0 milestone on Oct 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions