Skip to content

Instantly share code, notes, and snippets.

@Alphajeez96
Created July 2, 2026 00:34
Show Gist options
  • Select an option

  • Save Alphajeez96/d7a817a9b935e919a60374889e4d217b to your computer and use it in GitHub Desktop.

Select an option

Save Alphajeez96/d7a817a9b935e919a60374889e4d217b to your computer and use it in GitHub Desktop.
{
"summary": {
"total_raw_frames": 2372,
"cleaned_frames": 2371,
"anomalies_discarded": 1,
"valid_lap_count": 2,
"discarded_lap_count": 2
},
"valid_laps": [
{
"number": 1,
"classification": "flying",
"lap_time_s": 58.31,
"frame_count": 659,
"speeds": {"avg_kmh": 209.5, "top_kmh": 247.9, "min_kmh": 91},
"tyres": {
"fl": {"avg_c": 86, "min_c": 81.7, "max_c": 89.9},
"fr": {"avg_c": 82.9, "min_c": 78.7, "max_c": 86.8},
"rl": {"avg_c": 83.3, "min_c": 79.5, "max_c": 86.5},
"rr": {"avg_c": 80.3, "min_c": 76.6, "max_c": 83.6}
},
"throttle": {
"avg": 0.654,
"full_throttle_pct": 55.4,
"coast_pct": 30.1,
"above_90_pct": 58.1,
"below_10_pct": 30.1
},
"brake": {"avg": 0.134, "max": 0.92, "braking_pct": 30.6},
"steering": {"max": 110.1, "avg_abs": 21.707},
"gear": {"change_count": 18, "highest": 6, "lowest": 3}
},
{
"number": 2,
"classification": "flying",
"lap_time_s": 58.09,
"frame_count": 685,
"speeds": {"avg_kmh": 210.6, "top_kmh": 248.3, "min_kmh": 91.7},
"tyres": {
"fl": {"avg_c": 93.5, "min_c": 90.6, "max_c": 96.4},
"fr": {"avg_c": 90.5, "min_c": 87.5, "max_c": 93.2},
"rl": {"avg_c": 90.9, "min_c": 88.7, "max_c": 93.1},
"rr": {"avg_c": 87.9, "min_c": 85.6, "max_c": 89.9}
},
"throttle": {
"avg": 0.64,
"full_throttle_pct": 53.5,
"coast_pct": 30.3,
"above_90_pct": 56.4,
"below_10_pct": 30.3
},
"brake": {"avg": 0.133, "max": 0.93, "braking_pct": 30.6},
"steering": {"max": 109.9, "avg_abs": 21.517},
"gear": {"change_count": 18, "highest": 6, "lowest": 3}
}
],
"discarded_laps": [
{
"number": 0,
"classification": "out_lap",
"lap_time_s": 42.12,
"frame_count": 496,
"speeds": {"avg_kmh": 174.1, "top_kmh": 223.5, "min_kmh": 53.7},
"tyres": {
"fl": {"avg_c": 66.1, "min_c": 56.8, "max_c": 77.2},
"fr": {"avg_c": 62.7, "min_c": 53.7, "max_c": 73.2},
"rl": {"avg_c": 64.2, "min_c": 55.6, "max_c": 74.4},
"rr": {"avg_c": 60.7, "min_c": 52.7, "max_c": 70.2}
},
"throttle": {
"avg": 0.689,
"full_throttle_pct": 60.6,
"coast_pct": 26.4,
"above_90_pct": 62.7,
"below_10_pct": 26.4
},
"brake": {"avg": 0.089, "max": 0.62, "braking_pct": 26.8},
"steering": {"max": 70.2, "avg_abs": 13.067},
"gear": {"change_count": 14, "highest": 6, "lowest": 2}
},
{
"number": 3,
"classification": "in_lap",
"lap_time_s": 47.61,
"frame_count": 531,
"speeds": {"avg_kmh": 103.1, "top_kmh": 154.1, "min_kmh": 0},
"tyres": {
"fl": {"avg_c": 86.9, "min_c": 83.7, "max_c": 91.3},
"fr": {"avg_c": 83.8, "min_c": 80.5, "max_c": 88.1},
"rl": {"avg_c": 85.3, "min_c": 82.6, "max_c": 88.9},
"rr": {"avg_c": 82.3, "min_c": 79.5, "max_c": 85.7}
},
"throttle": {
"avg": 0.651,
"full_throttle_pct": 57.4,
"coast_pct": 31,
"above_90_pct": 59.7,
"below_10_pct": 31
},
"brake": {"avg": 0.13, "max": 0.92, "braking_pct": 26.2},
"steering": {"max": 110.4, "avg_abs": 21.732},
"gear": {"change_count": 12, "highest": 5, "lowest": 2}
}
],
"cleaning_notes": [
"Impossible speeds (not finite, < 0, or > 400 km/h): removed 1 frame(s) (ts=136186, spd=3987.6 km/h)",
"Decoded tyre temperatures: divided raw values by 10 (Rust recorder stores °C × 10 as i16 — see recorder.rs scales::TEMPERATURE)",
"Detected 4 lap(s) via dual-signal detection (position wrapping AND lap counter increment)",
"Speed threshold: ≤ 400 km/h (F1 top speed ~370 km/h, margin for slipstream/tow; also rejects NaN/Infinity and negative values)",
"RPM threshold: ≥ 0 and ≤ 15000 (typical F1 rev limit ~15000; also rejects NaN/Infinity)",
"Lap detection: both position wrapping (pos drop > 0.5 from >0.85 to <0.15) AND lap counter increment required — prevents false positives from position glitches",
"Out-lap classification: first lap with start_pos > 0.1 (recording began mid-track, lap is incomplete) — excluded from valid_laps",
"In-lap classification: last lap with end_pos < 0.9 (recording ended before lap completion) — excluded from valid_laps",
"Tyre temperature range: sanity-checked to -50–200 °C after ÷10 decode",
"All averaged metrics are Δt-weighted (weighted by time to next frame) to account for the recorder's non-uniform sample rate — simple arithmetic mean would bias toward denser sampling periods",
"Lap time derived from first and last valid frame in each detected lap: (last.ts - first.ts) / 1000"
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment