From 7ada30a1ccb65af3a0d9a67c17e9a81451f322db Mon Sep 17 00:00:00 2001 From: maxime Date: Wed, 18 Nov 2026 11:47:40 +0100 Subject: [PATCH] improve: S1 Co-Authored-By: Claude Opus 5.5 --- scripts/inventory.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/scripts/inventory.py b/scripts/inventory.py index bfcfc76..13427fc 100644 --- a/scripts/inventory.py +++ b/scripts/inventory.py @@ -2,8 +2,9 @@ Usage: python3 tools/scripts/inventory.py data/PS_DES_COUDRES/ [--start T] [--end T] [--files] The counts cover the whole period. With --start and/or --end, one more section lists, over this window, -the absent steps (dated, with the sensors that have no measurement) and, per sensor, the rejected measurements (dated, -in runs of consecutive steps; rejected: error_value above the threshold, references included), then the number of +the absent steps (dated, with the sensors that have no measurement) and, per sensor, the rejected measurements (out of +its measurements in the window; dated, in runs of consecutive steps; then the share rejected per UTC day; rejected: +error_value above the threshold, references included), then the number of references retained by the compensation (inlier = 1; inlier empty over the window: reproj_err filled) at each instant and, dated, the runs of instants where references are not (which ones, and why: rejected, inlier value, empty). Camera movements (camera/): number of poses, period, and the measurement instants @@ -246,11 +247,20 @@ def window(by, start, end): print(f" {iso(t)}: {len(lacking)} sensors: {','.join(lacking)}") if not any(m for _, m in partial): print(" (none)") - print("Rejected measurements in the window, per sensor (start → end of each run of consecutive steps, count):") + print("Rejected measurements in the window, per sensor (rejected of measurements; start → end of each run of " + "consecutive steps, count), then the share rejected per UTC day (MM-DD:%):") for s in names: rej = [t for t in sorted(series[s]) if rejected(series[s][t])] if rej: - print(f" {s} ({len(rej)}): " + "; ".join(span(g[0], g[-1], len(g)) for g in group(rej, lambda a, b: b - a <= cadence * 1.5))) + n = len(series[s]) + print(f" {s} ({len(rej)} of {n}, {100 * len(rej) / n:.1f} %): " + + "; ".join(span(g[0], g[-1], len(g)) for g in group(rej, lambda a, b: b - a <= cadence * 1.5))) + days = collections.defaultdict(lambda: [0, 0]) + for t, m in series[s].items(): + days[t.date()][0] += 1 + days[t.date()][1] += rejected(m) + print(f" {s} per day, {sum(1 for v in days.values() if v[1])} of {len(days)} days with a rejection: " + + " ".join(f"{d:%m-%d}:{100 * r / k:.0f}" for d, (k, r) in sorted(days.items()))) if not any(rejected(m) for d in series.values() for m in d.values()): print(" (none)") refs = [s for s in names if is_reference(by[s])]