Skip to content

Python tool for aircraft Doppler audio geolocation using historical ADS-B flight data (Source-available)

Keep height and seed identities distinct in refinement accounting (#10)

Cinna Davis57909c355fb6
diff --git a/evidence/product-20261103/current-main-integration-tests.json b/evidence/product-20261103/current-main-integration-tests.json
new file mode 100644
index 0000000..d97dc03
--- /dev/null
+++ b/evidence/product-20261103/current-main-integration-tests.json
@@ -0,0 +1,12 @@
+{
+ "source_commit": "26887fd",
+ "command": "PYTHONPATH=src /home/cinna/aircraft-audio-geolocation/.venv/bin/python -m pytest -q --junitxml=results/w5-current-main-20261103.xml",
+ "pytest_test_cases_passed": 260,
+ "subtests_passed": 6,
+ "junit_tests_including_subtests": 266,
+ "failures": 0,
+ "errors": 0,
+ "skipped": 0,
+ "elapsed_s": 95.045,
+ "scope": "Current-main producer/product integration with finite-evidence relay; no new empirical geolocation acceptance."
+}
diff --git a/evidence/product-20261103/mode-height-verification.json b/evidence/product-20261103/mode-height-verification.json
new file mode 100644
index 0000000..4842955
--- /dev/null
+++ b/evidence/product-20261103/mode-height-verification.json
@@ -0,0 +1,20 @@
+{
+ "base_commit": "26887fd",
+ "before_fix": {
+ "passed": 2,
+ "failed": 2,
+ "new_cases": "same horizontal point/clock with different elevation or seed identity"
+ },
+ "after_fix": {
+ "passed": 29,
+ "failed": 0,
+ "skipped": 0,
+ "elapsed_s": 27.1
+ },
+ "command": "PYTHONPATH=src /home/cinna/aircraft-audio-geolocation/.venv/bin/python -m pytest -q tests/test_automatic.py tests/test_automatic_finite.py tests/test_automatic_profile.py tests/test_decision_invariants.py --junitxml=results/w5-mode-height-checks-20261103.xml",
+ "files_sha256": {
+ "src/aircraft_geoloc/automatic.py": "b2af860efef5aa9fccd412005ed5a6c57173dd0f77da692ff14ac855f09dd082",
+ "tests/test_automatic.py": "c44ca92502a46f0cdfd38b29aaf6d623b337dc7d42ecf7d7173d2c0df32dc4e1"
+ },
+ "scope": "Exact refinement bookkeeping only; no additional finite-search or real-accuracy claim."
+}
diff --git a/src/aircraft_geoloc/automatic.py b/src/aircraft_geoloc/automatic.py
index 580080a..80b9d04 100644
--- a/src/aircraft_geoloc/automatic.py
+++ b/src/aircraft_geoloc/automatic.py
@@ -213,7 +213,8 @@ def _decide(search, events, prepared_events, measurements, indexes, terrain, sta
# The index iterator is bounded by the same local acoustic support envelope.
def mode_key(row):
return (tuple(row.get("event_indices", range(len(prepared_events)))), tuple(row["flight_ids"]),
- tuple(row.get("pass_emission_times_s", [])), row["lat"], row["lon"], row["recording_start_time_s"])
+ tuple(row.get("pass_emission_times_s", [])), row["lat"], row["lon"], row["recording_start_time_s"],
+ row.get("elev_m"), row.get("mode_id"))
retained_keys = {mode_key(row) for row in raw}
refined_keys = set()
diff --git a/tests/test_automatic.py b/tests/test_automatic.py
index 5894927..fa4f9f9 100644
--- a/tests/test_automatic.py
+++ b/tests/test_automatic.py
@@ -159,8 +159,9 @@ def test_refinement_adapter_preserves_raw_residual_and_avoids_double_normalizati
assert _comparable_refinement(normalized, original, events)["score"] == normalized["score"]
[email protected]("second", [{"lat": 41.}, {"recording_start_time_s": 1790000010.}])
-def test_refinement_preserves_same_association_spatial_and_clock_modes(tmp_path, monkeypatch, second):
[email protected]("second", [{"lat": 41.}, {"recording_start_time_s": 1790000010.},
+ {"elev_m": 180.}, {"mode_id": "separate-seed"}])
+def test_refinement_preserves_same_association_model_modes(tmp_path, monkeypatch, second):
from types import SimpleNamespace
from aircraft_geoloc import automatic, matching
events = [{"event_id": f"event-{i}", "start_s": i*100., "end_s": i*100.+20., "band_hz": [90., 200.],
@@ -172,7 +173,8 @@ def test_refinement_preserves_same_association_spatial_and_clock_modes(tmp_path,
raw = [seed, dict(seed, score=-2., **second)]
seen = []
def refine(candidate, *args, **kwargs):
- seen.append((candidate["lat"], candidate["lon"], candidate["recording_start_time_s"]))
+ seen.append((candidate["lat"], candidate["lon"], candidate["recording_start_time_s"],
+ candidate.get("elev_m"), candidate.get("mode_id")))
return dict(candidate, score=candidate["score"]+.1)
monkeypatch.setattr(matching, "refine_candidate", refine)
monkeypatch.setattr(matching, "profile_candidate", lambda candidate, *args, **kwargs: dict(candidate, sensitivity={"complete": False}))
@@ -185,7 +187,8 @@ def test_refinement_preserves_same_association_spatial_and_clock_modes(tmp_path,
return dict(status=status, **fields)
final = automatic._decide(search, events, events, [None]*2, [index], None, state, tmp_path,
{"refine_finalists": 5}, finish, lambda: None)
- assert set(seen) == {(row["lat"], row["lon"], row["recording_start_time_s"]) for row in raw}
+ assert set(seen) == {(row["lat"], row["lon"], row["recording_start_time_s"],
+ row.get("elev_m"), row.get("mode_id")) for row in raw}
assert final["status"] == "inconclusive"
diagnostics = json.loads((tmp_path/"refined-candidates.json").read_text())["matching_diagnostics"]
assert diagnostics["retained_hypotheses"] == 2