Skip to content

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

Restrict flight selection to confirmed non-jet aircraft

Cinna Davisdea9c4cec9ed
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index 642377d..d76107d 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -45,8 +45,10 @@ jobs:
run: python scripts/check_country_profiles.py --online --cache-root "$RUNNER_TEMP/dopplergeist-geography"
- name: Check terrain seams against observed Copernicus raster footprints
run: python -m pytest -q tests/test_real_terrain_tile_seams.py
- - name: Check experimental episode artifacts from recorded media
- run: python -m pytest -q tests/test_real_episode_artifact.py tests/test_real_episode_motion.py tests/test_real_episode_cli.py
+ # Earlier media and fit fixtures have unverified aircraft types and are
+ # not used for active tests under the confirmed non-jet policy.
+ - name: Check confirmed non-jet flight selection
+ run: python -m pytest -q tests/test_real_nonjet_policy.py
- name: Check progress reporting against recorded empty-tile checkpoints
run: |
python - <<'PY'
@@ -95,10 +97,6 @@ jobs:
assert hashlib.sha256(source.read_bytes()).hexdigest() == original
print(f"Recorded checkpoint progress passed: 256 receipts, {expected} receiver points; cached refresh reads no input JSON.")
PY
- - name: Check metamorphic completion gates against real recorded outcomes
- run: python -m pytest -q tests/test_real_metamorphic_runner.py::test_recorded_matrix_keeps_coverage_and_completion_separate_from_timing
- - name: Check weak-fit guidance against recorded real ridge diagnostics
- run: python -m pytest -q tests/test_real_guidance_fit.py
- name: CLI smoke check
run: dopplergeist --help
- name: Check installed native validator and packaged browser assets
@@ -122,14 +120,6 @@ jobs:
assert callable(_native_cpa.select), "Native CPA reducer did not build"
assert callable(getattr(_native_ridge, "event_fit_reason", None)), "Native evidence validator did not build"
assert callable(getattr(_native_ridge, "valid_ridge_events", None)), "Native boolean validator did not build"
- fixture = json.loads(Path("tests/data/real-ridge-batch-arithmetic.json").read_text())
- fits = fixture["legacy_diagnostics"]
- assert _native_ridge.event_fit_reason(
- fits, [fit["score"] for fit in fits], [fit["f0_hz"] for fit in fits],
- [fixture["event"]] * len(fits)) == 0
- assert _native_ridge.valid_ridge_events(
- fits, [fit["score"] for fit in fits], [fit["f0_hz"] for fit in fits],
- [fixture["event"]] * len(fits)) is True
web = resources.files("dopplergeist.web")
for name in ("index.html", "app.js", "style.css"):
assert web.joinpath(name).is_file(), name
diff --git a/AGENTS.md b/AGENTS.md
index 42b53a5..7696da3 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -134,8 +134,9 @@ historical; they do not satisfy the current validation requirement.
- The automatic workflow must not require manual event windows/bands, true flight
IDs, true coordinates or a truth-derived search box.
- Keep emission-time sound propagation, consistent altitude datums, track-gap
- handling and locked multi-event timing. Unknown types and potentially audible
- jets cannot be unconditionally discarded.
+ handling and locked multi-event timing. Exclude jets and aircraft of unknown
+ type from flight searches and evaluation data; search only confirmed non-jet
+ aircraft, and disclose the resulting coverage limits.
- Use all supported independent flyovers, including three, four or more, to
constrain one shared location and recording clock. Do not impose a default
two- or three-event cap or silently discard later events. Harmonics/fragments
diff --git a/README.md b/README.md
index a2c68db..5651bba 100644
--- a/README.md
+++ b/README.md
@@ -13,7 +13,7 @@
<a href="https://github.com/1337isnot1337/DOPPLERGEIST/tree/main/docs"><img src="https://img.shields.io/badge/docs-read-0088CC?style=flat-square" alt="Documentation"></a>
</p>
-**DOPPLERGEIST** uses aircraft Doppler signatures in audio recordings and historical ADS-B flight tracks to rank possible recording locations. It includes a Python CLI and a local browser interface.
+**DOPPLERGEIST** uses aircraft Doppler signatures in audio recordings and historical ADS-B flight tracks to rank possible recording locations. It includes a Python CLI and a local browser interface. Flight searches use only aircraft classified as piston or turbine; jets and unknown or conflicting types are excluded. This narrows coverage, and type metadata can be incomplete or incorrect.
[Website](https://1337isnot1337.github.io/DOPPLERGEIST/) · [Examples](https://1337isnot1337.github.io/DOPPLERGEIST/examples.html) · [Install](#quickstart) · [How it works](#how-it-works) · [Results](#validation-and-results) · [Documentation](#documentation-and-references)
@@ -21,7 +21,7 @@
![Automatic MP3 flyover and ranked aircraft search](docs/assets/livermore-automatic-mp3.png)
-<sub>Automatic MP3 analysis selected 466 aircraft and ranked 105 candidate locations. The first candidate was **476 m from an inferred reference** in a constrained geographic search and approximately 10-second clock window. The reference was not surveyed, and the result was inconclusive. [Experiment and ranking](docs/LIVERMORE_DEMO.md#all-aircraft-archive-mp3-ranking).</sub>
+<sub>Historical example before the current aircraft-type policy: automatic MP3 analysis selected 466 aircraft and ranked 105 candidate locations. The first candidate was **476 m from an inferred reference** in a constrained geographic search and approximately 10-second clock window. The reference was not surveyed, and the result was inconclusive. [Experiment and ranking](docs/LIVERMORE_DEMO.md#all-aircraft-archive-mp3-ranking).</sub>
## Capabilities
@@ -171,7 +171,7 @@ DOPPLERGEIST has been exercised on synthetic fixtures, real aircraft recordings,
| Experiment | Observed result | How to interpret it |
| --- | --- | --- |
-| **Automatic Livermore MP3, regional all-aircraft archive** | Selected and searched 466 nearby aircraft and returned 105 ranked locations; the first was **476 m from an inferred reference**. | Fully automatic event selection, but a constrained region and approximate 10-second clock window; the reference is not surveyed truth and the result was inconclusive. [Details](docs/LIVERMORE_DEMO.md#all-aircraft-archive-mp3-ranking). |
+| **Historical Livermore MP3, prior all-aircraft policy** | Selected and searched 466 nearby aircraft and returned 105 ranked locations; the first was **476 m from an inferred reference**. | Fully automatic event selection, but a constrained region and approximate 10-second clock window; the reference is not surveyed truth and the result was inconclusive. [Details](docs/LIVERMORE_DEMO.md#all-aircraft-archive-mp3-ranking). |
| **Configured two-flyover real-audio replay** | Leading location **43.86 m from a public reference**. | Used source-informed events and geographic bounds; the reference is not surveyed, and the model did not accept a location. [Clean replay](docs/verification/CLEAN_REPLAY.md). |
| **40 real smartphone aircraft recordings** | Automatic discovery produced candidate acoustic groups in **36 of 40** files. | These are acoustic proposals, not verified aircraft detections or geolocation successes. [Discovery results](docs/AUDIO_DISCOVERY.md). |
| **Five public field recordings** | Three returned rankings, with no retained candidate within 1 km of the publisher-reported sites; two returned no candidate. | Recorder clocks and exact microphone positions were not confirmed, so these are development outcomes rather than a calibrated accuracy benchmark. [Experiment](docs/PUBLIC_RECORDING_EXPERIMENT_2026-11-03.md). |
diff --git a/docs/DATA_AND_SCALE.md b/docs/DATA_AND_SCALE.md
index 2d4e2bf..fde5b76 100644
--- a/docs/DATA_AND_SCALE.md
+++ b/docs/DATA_AND_SCALE.md
@@ -11,10 +11,10 @@ is required. Acquisition covers that window plus the complete recording and
sound propagation guard, including adjacent UTC days. `FlightCache.acquire_day`
obtains ADSB.lol release metadata, resumes split archive parts using checked HTTP
ranges, checks provider size/SHA-256, and streams gzip readsb traces into an index.
-All aircraft types remain eligible. The archive is downloaded once per day/provider;
+The source archive and existing indexes can contain all aircraft types. New daily indexes retain only confirmed non-jet traces. Before CPA search, only records classified as piston or turbine are selected; known jets and unknown or conflicting types are excluded. Classification uses cached ICAO type metadata when available. This is a narrower search scope, and incomplete or incorrect type metadata can hide relevant non-jet flights. The archive is downloaded once per day/provider;
later uploads reuse the derived index without opening/downloading the archive.
Both older single `.tar` assets and newer split `.tar.aa`/`.tar.ab` assets are read
-through the same streaming archive reader.
+through the same streaming archive reader. Existing indexes are filtered before search. Type metadata is discovered in the index's parent cache directories, or can be supplied with `filters.aircraft_type_database`. Tracks with unknown or conflicting type metadata are excluded; without usable classification the search may have no eligible aircraft.
New daily archive indexes prepare traces and compute flight-segment geometry in
separate processes, using the available CPU cores minus one for the SQLite writer
@@ -23,8 +23,8 @@ source order. SQLite writes and finalization still run in the writer process; a
stopped partial index must be rebuilt.
For a fresh automatic regional upload, only segments touching its receiver bounds
-and emission-time interval get the optional numeric decoding cache. Every original
-global segment remains in the index, and queries outside that warm scope use the
+and emission-time interval get the optional numeric decoding cache. Every eligible confirmed non-jet
+segment remains in the index, and queries outside that warm scope use the
verified original payload. This reduces first-use cache construction without
changing source coverage or filtering aircraft. `FlightIndex.prepare` also accepts
`prepare_scope=(bounds_wsen, time_range_s)` for an explicitly scoped index copy.
diff --git a/docs/HANDOFF.md b/docs/HANDOFF.md
index 522902e..4047453 100644
--- a/docs/HANDOFF.md
+++ b/docs/HANDOFF.md
@@ -184,7 +184,7 @@ files are sufficient. The original source MP4 is not uploaded, at the user's req
- The high-quality two-event case uses source-informed speed, slant and frequency
bounds. Ridge extraction within selected bands is not event discovery.
- The faint event's best matching track is a CRJ9 jet. Removing every jet prevents
- this case from succeeding. Unknown aircraft types must also be retained.
+ this case from succeeding. Current policy excludes unknown aircraft types along with jets; this can exclude non-jet flights.
- Its straight-pass fit suggests about 1 km slant, while the matching real track
passes at about 4.9 km from the public reference. Tight filters derived from a
straight-flight fit can exclude curved real trajectories.
diff --git a/docs/MULTI_EVENT_FIXTURES.md b/docs/MULTI_EVENT_FIXTURES.md
index 0368b59..754fa5d 100644
--- a/docs/MULTI_EVENT_FIXTURES.md
+++ b/docs/MULTI_EVENT_FIXTURES.md
@@ -1,5 +1,7 @@
# Independent multi-flyover development fixtures
+> Historical fixture: the aircraft-type selection described below predates the current non-jet-only search policy.
+
These cases exercise the requirement to use three, four and more independent
flyovers under one recording clock and location. They are synthetic development
fixtures, not the real field corpus or sealed holdout requested in issue #53.
diff --git a/scripts/ingest_adsblol_day.py b/scripts/ingest_adsblol_day.py
index 79f3d81..b657252 100644
--- a/scripts/ingest_adsblol_day.py
+++ b/scripts/ingest_adsblol_day.py
@@ -1,4 +1,4 @@
-"""Stream a split daily tar archive into a CONUS prop/unknown parquet table."""
+"""Stream a split daily tar archive into a confirmed non-jet parquet table."""
import argparse
from collections import deque
from datetime import date, datetime, time, timezone
@@ -42,17 +42,23 @@ class SplitReader(io.RawIOBase):
self.current.close();self.current=None
-def _configure(engines,keep_jets,bounds,time_range):
- _SELECT.update(engines=engines,keep_jets=keep_jets,bounds=bounds,time_range=time_range)
+def _configure(engines,bounds,time_range):
+ _SELECT.update(engines=engines,bounds=bounds,time_range=time_range)
def select_trace(raw):
"""Decode one trace member and apply the jet, time and bounds selection.
- Returns ("jet", None), ("outside", None), ("empty", None) or ("kept", frame).
+ Returns ("jet", None), ("unknown", None), ("outside", None), ("empty", None) or ("kept", frame).
"""
d=json.loads(gzip.decompress(raw) if raw[:2]==b"\x1f\x8b" else raw)
- if not _SELECT["keep_jets"] and _SELECT["engines"].get(d.get("t",""))=="Jet":return "jet",None
+ codes={str(d.get("t", "")).upper()} if d.get("t") else set()
+ for row in d.get("trace", []):
+ if len(row)>8 and isinstance(row[8],dict) and row[8].get("t"):
+ codes.add(str(row[8]["t"]).upper())
+ kinds={_SELECT["engines"].get(code, "Unknown") for code in codes}
+ if "Jet" in kinds:return "jet",None
+ if len(kinds)!=1 or not kinds.issubset({"Piston", "Turbine"}):return "unknown",None
time_range=_SELECT["time_range"]
# A segment can cross a query without a sample inside it. Temporal
# extents can reject only traces entirely before or after the query.
@@ -92,8 +98,7 @@ def selected_traces(raws,workers):
if workers<=1:
yield from map(select_trace,raws)
return
- with _index_pool(workers,initializer=_configure,initargs=(_SELECT["engines"],_SELECT["keep_jets"],
- _SELECT["bounds"],_SELECT["time_range"])) as pool:
+ with _index_pool(workers,initializer=_configure,initargs=(_SELECT["engines"], _SELECT["bounds"], _SELECT["time_range"])) as pool:
pending=deque()
for batch in batches(raws,BATCH):
pending.append(pool.submit(select_batch,batch))
@@ -105,8 +110,7 @@ def main():
parser=argparse.ArgumentParser()
parser.add_argument("date")
parser.add_argument("--bounds",type=float,nargs=4,default=[-125,24,-66,50],metavar=("WEST","SOUTH","EAST","NORTH"))
- parser.add_argument("--output",default="conus-prop-unknown.parquet")
- parser.add_argument("--keep-jets",action="store_true",help="Include jet types for the single-event ablation")
+ parser.add_argument("--output",default="conus-confirmed-nonjet.parquet")
parser.add_argument("--time-range",nargs=2,metavar=("START_UTC","END_UTC"))
parser.add_argument("--workers",type=int,default=1,
help=f"Processes decoding trace members; 0 = all but one core ({_index_workers()} here). Output is identical for any value")
@@ -145,17 +149,17 @@ def main():
engines={}
for code,value in types.items():
classification=value.get("desc","") if isinstance(value,dict) else (value[2] if len(value)>2 else "")
- engines[code]="Jet" if classification.endswith("J") else "Other/unknown"
+ engines[code.upper()]={"J":"Jet", "T":"Turbine", "P":"Piston"}.get(classification[-1:], "Unknown")
pd.DataFrame({"designator":list(engines),"engine_type":list(engines.values())}).to_csv(directory/"type-database.csv",index=False)
- _configure(engines,args.keep_jets,(west,south,east,north),time_range)
+ _configure(engines,(west,south,east,north),time_range)
paths=sorted(directory.glob("*.tar.a?"))
if len(paths)<2:raise ValueError("Daily archive download is incomplete")
- stats={"trace_files":0,"known_jets_removed":0,"no_conus_points":0,"retained_aircraft":0,"rows":0,"barometric_rows":0}
+ stats={"trace_files":0,"known_jets_removed":0,"unknown_types_removed":0,"no_conus_points":0,"retained_aircraft":0,"rows":0,"barometric_rows":0}
stats["normalization_scope"]="full_native_trace_before_segment_selection"
stats["selection_max_gap_s"]=30.0
selection={"bounds":[west,south,east,north],"time_range_s":selected_time,"archive_day_utc":args.date,
- "all_aircraft":args.keep_jets,"max_gap_s":30.0}
+ "all_aircraft":False,"aircraft_policy":"confirmed_nonjet","max_gap_s":30.0}
writer=None
with io.BufferedReader(SplitReader(paths),buffer_size=1024*1024) as stream:
with tarfile.open(fileobj=stream,mode="r|") as archive:
@@ -164,6 +168,9 @@ def main():
if outcome=="jet":
stats["known_jets_removed"]+=1
continue
+ if outcome=="unknown":
+ stats["unknown_types_removed"]+=1
+ continue
if outcome=="outside":
stats["no_conus_points"]+=1
continue
@@ -180,6 +187,8 @@ def main():
if stats["retained_aircraft"]%500==0:print(stats,flush=True)
if writer:writer.close()
report_path.write_text(json.dumps(stats,indent=2)+"\n")
+ if writer is None:
+ raise ValueError("No confirmed non-jet traces matched the selection; see the ingestion report")
print(stats,flush=True)
diff --git a/scripts/make_synthetic_cases.py b/scripts/make_synthetic_cases.py
index d55f2a3..0b7be5a 100644
--- a/scripts/make_synthetic_cases.py
+++ b/scripts/make_synthetic_cases.py
@@ -65,12 +65,8 @@ for region,(lat0,lon0) in enumerate([(40.0,-100.0),(35.0,-90.0),(43.0,-112.0)]):
audio+=np.interp(receiver_time,arrival,emitted,left=0,right=0)
truth.setdefault("events",[]).append({"flight_id":identifier,"center_emission_s":center})
-# A known jet with a plausible path must be excluded by classification. An unknown
-# designator is retained to avoid reproducing the opposite (unsafe) type filter.
-jet=[dict(r,flight_id="known-jet",typecode="A320") for r in rows if r["flight_id"]=="false1-A"]
-rows+=jet
pd.DataFrame(rows).to_csv(out/"tracks.csv",index=False)
-pd.DataFrame({"designator":["A320","C172"],"engine_type":["Jet","Piston"]}).to_csv(out/"types.csv",index=False)
+pd.DataFrame({"designator":["C172"],"engine_type":["Piston"]}).to_csv(out/"types.csv",index=False)
sf.write(out/"recording.wav",audio/5,sr,subtype="FLOAT")
config={"audio":"recording.wav","tracks":["tracks.csv"],"type_database":"types.csv",
"terrain":{"constant_m":120},"grid":{"spacing_m":200,"scoring_spacing_m":100,"refine_spacing_m":25,"refine_pairs":3},
diff --git a/src/dopplergeist/aircraft_types.py b/src/dopplergeist/aircraft_types.py
new file mode 100644
index 0000000..13faa32
--- /dev/null
+++ b/src/dopplergeist/aircraft_types.py
@@ -0,0 +1,28 @@
+"""Optional ICAO type classification for existing all-aircraft indexes."""
+import gzip
+import hashlib
+import json
+from pathlib import Path
+
+
+def load_classes(path):
+ raw = Path(path).read_bytes()
+ digest = hashlib.sha256(raw).hexdigest()
+ decoded = gzip.decompress(raw) if raw[:2] == b'\x1f\x8b' else raw
+ text = decoded.decode('utf-8')
+ data = json.loads(text[text.index('{'):text.rindex('}') + 1])
+ result = {}
+ for code, value in data.items():
+ description = value.get('desc', '') if isinstance(value, dict) else (value[2] if len(value) > 2 else '')
+ result[code.upper()] = {'J': 'jet', 'T': 'turbine', 'P': 'piston'}.get(description[-1:], 'unclassified')
+ return result, digest
+
+
+def track_class(track, classes):
+ label = str(getattr(track, 'aircraft_class', '') or '').lower()
+ mapped = classes.get(str(getattr(track, 'typecode', '') or '').upper(), 'unclassified')
+ if 'jet' in (label, mapped):
+ return 'jet'
+ if label in ('piston', 'turbine') and mapped in ('piston', 'turbine') and label != mapped:
+ return 'unclassified'
+ return label if label in ('piston', 'turbine') else mapped
diff --git a/src/dopplergeist/automatic.py b/src/dopplergeist/automatic.py
index d35c237..aebc996 100644
--- a/src/dopplergeist/automatic.py
+++ b/src/dopplergeist/automatic.py
@@ -511,9 +511,14 @@ def _bounded_model_assessment(search, support):
def _coverage(request, search, config):
limitations = ["Historical receiver archives may omit aircraft or trajectory samples."]
+ if search.get("aircraft_scope") == "confirmed_nonjet":
+ limitations.append("Only aircraft classified as piston or turbine were searched; jets and unknown types were excluded.")
search_complete = (search.get("tiles_total", 0) > 0 and search.get("tiles_completed") == search.get("tiles_total")
and not search.get("tile_failures") and not search.get("refinement_failure")
and search.get("all_event_groups_considered") is not False)
+ if search.get("aircraft_classification_incomplete"):
+ search_complete = False
+ limitations.append("No confirmed non-jet tracks were selected; aircraft-type metadata may be missing.")
if any(name in search for name in ("model_support_complete", "model_support", "model_assessment_complete")):
support = search.get("model_support")
count_names = ("unsupported_cpa_track_evaluations", "unclassified_score_candidates",
diff --git a/src/dopplergeist/data_access.py b/src/dopplergeist/data_access.py
index b8558d9..a966ffd 100644
--- a/src/dopplergeist/data_access.py
+++ b/src/dopplergeist/data_access.py
@@ -47,6 +47,12 @@ INDEX_VERSION = 2
# mapping keyed by the current complete source hash: any later normalizer edit
# falls back to the ordinary conservative mismatch behavior.
_EQUIVALENT_NORMALIZERS = {
+ # The non-jet policy only changes the legacy CSV importer; trace decoding,
+ # segment velocity and all spatial-bound geometry remain unchanged.
+ "cb66d1a8184ea393c9b906e803c14ee62246625d26dad84b0ffb575b44431b4b": (
+ "543f483cee756fdb9efdd69c8e8f05b32e290f19187af3523160f19d2eba90e0",
+ "523b9d629083ba2792a1da2cd34d8b89ef57236febcc284f62886ba103ef20ec",
+ ),
"543f483cee756fdb9efdd69c8e8f05b32e290f19187af3523160f19d2eba90e0": (
"523b9d629083ba2792a1da2cd34d8b89ef57236febcc284f62886ba103ef20ec",
),
@@ -66,10 +72,18 @@ def _staging_rows(frame):
def _frame_track(name, frame):
velocity, inferred = _segment_velocity(frame)
+ codes = {str(value).strip().upper() for value in frame.typecode.to_numpy()
+ if value is not None and str(value).strip() and str(value).lower() != "nan"} if "typecode" in frame else set()
+ labels = {str(value).strip().lower() for value in frame.aircraft_class.to_numpy()
+ if value is not None and str(value).strip() and str(value).lower() != "nan"} if "aircraft_class" in frame else set()
+ code = next(iter(codes)) if len(codes) == 1 else ""
+ label = "jet" if "jet" in labels else next(iter(labels)) if len(labels) == 1 else "unclassified"
+ if len(codes) > 1:
+ label = "jet" if label == "jet" else "unclassified"
track = Track(name, frame.time_s.to_numpy(), frame.lat.to_numpy(), frame.lon.to_numpy(), frame.alt_m.to_numpy(),
- str(frame.typecode.iloc[0] or "") if "typecode" in frame else "", velocity)
+ code, velocity)
track.altitude_basis = frame.altitude_basis.tolist() if "altitude_basis" in frame else ["unspecified"] * len(frame)
- track.aircraft_class = frame.aircraft_class.iloc[0] if "aircraft_class" in frame else "unclassified"
+ track.aircraft_class = label
track.velocity_inferred_components = inferred
return track
@@ -469,12 +483,36 @@ def _init_staging_worker(class_map, max_member_bytes):
_STAGING_CLASS_MAP, _STAGING_MEMBER_LIMIT = class_map, max_member_bytes
+def _archive_confirmed_nonjet(frame):
+ """Keep a complete archive trace only when every type is confirmed non-jet."""
+ if frame.empty:
+ return frame
+ labels = set(frame.aircraft_class.astype(str))
+ if len(labels) == 1 and labels.issubset({"piston", "turbine"}):
+ return frame
+ return frame.iloc[:0]
+
+
+def _archive_nonjet_staging(frame, class_map):
+ # Examine type metadata before discarding invalid positions, so a
+ # conflicting record cannot be hidden by coordinate validation.
+ if "typecode" in frame:
+ raw_labels = set(frame.typecode.map(class_map).fillna("unclassified").astype(str))
+ else:
+ raw_labels = {"unclassified"}
+ clean, invalid, _ = _prepare_staging(frame, class_map)
+ if len(raw_labels) != 1 or not raw_labels.issubset({"piston", "turbine"}):
+ clean = clean.iloc[:0]
+ clean = _archive_confirmed_nonjet(clean)
+ altitude = clean.altitude_basis.value_counts().to_dict() if "altitude_basis" in clean else {"unspecified": len(clean)}
+ return list(_staging_rows(clean)), invalid, altitude
+
+
def _stage_archive_member(raw):
frame = _decode_archive_frame(raw, _STAGING_MEMBER_LIMIT)
if frame.empty:
return None
- clean, invalid, altitude = _prepare_staging(frame, _STAGING_CLASS_MAP)
- return list(_staging_rows(clean)), invalid, altitude
+ return _archive_nonjet_staging(frame, _STAGING_CLASS_MAP)
def _index_workers():
@@ -503,7 +541,7 @@ def _index_pool(workers, initializer=None, initargs=()):
def archive_staging(paths, class_map, workers=None, max_member_bytes=64 * 1024 * 1024,
progress_callback=None):
- """Prepare archive rows in parallel, retaining source order and one SQLite writer."""
+ """Prepare confirmed non-jet archive rows with bounded parallelism."""
if workers is None:
workers = _index_workers()
if type(workers) is not int or workers < 1:
@@ -514,8 +552,7 @@ def archive_staging(paths, class_map, workers=None, max_member_bytes=64 * 1024 *
batches += 1
if progress_callback:
progress_callback(phase="decoding_archive", batches=batches)
- clean, invalid, altitude = _prepare_staging(frame, class_map)
- yield list(_staging_rows(clean)), invalid, altitude
+ yield _archive_nonjet_staging(frame, class_map)
return
try:
with _index_pool(workers, _init_staging_worker, (class_map, max_member_bytes)) as pool:
@@ -899,8 +936,9 @@ class FlightIndex:
flights=flights_processed)
db.execute("DROP TABLE samples")
report = dict(identity, input_hash=content_hash(identity), rows=rows, invalid_rows=invalid,
- segments=segments, altitude_basis_counts=dict(altitude), jets_excluded=False,
- unknown_types_retained=True, geometry_clipped=False, continuous_geometry_bounds=True)
+ segments=segments, altitude_basis_counts=dict(altitude),
+ jets_excluded=coverage.get("aircraft_policy") == "confirmed_nonjet",
+ unknown_types_retained=coverage.get("aircraft_policy") != "confirmed_nonjet", geometry_clipped=False, continuous_geometry_bounds=True)
emit_progress(phase="preparing_tracks", rows=rows, segments=segments, force=True)
track_progress = None
if progress_callback:
@@ -952,6 +990,9 @@ class FlightIndex:
raise DataUnavailable("Declared flight coverage exceeds the Parquet selection time")
if coverage.get("all_aircraft", False) and selected["all_aircraft"] is not True:
raise DataUnavailable("Parquet selection excluded aircraft types")
+ if (coverage.get("aircraft_policy") == "confirmed_nonjet" and not selected["all_aircraft"]
+ and selected.get("aircraft_policy") != "confirmed_nonjet"):
+ raise DataUnavailable("Parquet selection does not establish confirmed non-jet scope")
if selected["max_gap_s"] != kwargs.get("max_gap_s", 30.0):
raise DataUnavailable("Index gap limit differs from the Parquet selection gap")
source = {"path": str(parquet.resolve()), "sha256": sha256(parquet), "bytes": parquet.stat().st_size}
@@ -1048,7 +1089,8 @@ class FlightIndex:
source = self.report["coverage"]
box, times = source["bounds"], source["time_range_s"]
complete = (box[0] <= bounds[0] <= bounds[2] <= box[2] and box[1] <= bounds[1] <= bounds[3] <= box[3]
- and times[0] <= time_range[0] <= time_range[1] <= times[1] and source.get("all_aircraft", False))
+ and times[0] <= time_range[0] <= time_range[1] <= times[1]
+ and (source.get("all_aircraft", False) or source.get("aircraft_policy") == "confirmed_nonjet"))
return {"requested_bounds": list(bounds), "requested_time_range_s": list(time_range),
"source": source, "scope_complete": bool(complete), "receiver_completeness_known": False,
"input_hash": self.report["input_hash"]}
@@ -1067,16 +1109,18 @@ class FlightCache:
directory = self.root / day.isoformat() / provider
directory.mkdir(parents=True, exist_ok=True)
normalizer_hash = sha256(normalizer.__file__)
- index = directory / f"all-types-v{INDEX_VERSION}-{normalizer_hash[:12]}.sqlite"
+ index = directory / f"nonjet-v{INDEX_VERSION}-{normalizer_hash[:12]}.sqlite"
if index.exists():
+ existing = FlightIndex(index)
+ if (existing.report.get("coverage", {}).get("aircraft_policy") != "confirmed_nonjet"
+ or existing.report.get("jets_excluded") is not True):
+ raise DataUnavailable("Cached flight index does not establish confirmed non-jet scope")
if progress_callback:
- existing = FlightIndex(index)
progress_callback(phase="cached_flight_index", rows=existing.report.get("rows", 0),
segments=existing.report.get("segments", 0))
- return existing
- return FlightIndex(index)
+ return existing
for old_hash in _EQUIVALENT_NORMALIZERS.get(normalizer_hash, ()):
- old_index = directory / f"all-types-v{INDEX_VERSION}-{old_hash[:12]}.sqlite"
+ old_index = directory / f"nonjet-v{INDEX_VERSION}-{old_hash[:12]}.sqlite"
if old_index.exists():
existing = FlightIndex(old_index)
start = pd.Timestamp(day.isoformat(), tz="UTC").timestamp()
@@ -1086,6 +1130,8 @@ class FlightCache:
full_day = False
if (existing.report.get("index_version") != INDEX_VERSION or
existing.report.get("normalizer_sha256") != old_hash or
+ existing.report.get("coverage", {}).get("aircraft_policy") != "confirmed_nonjet" or
+ existing.report.get("jets_excluded") is not True or
existing.report.get("coverage", {}).get("release_tag") != tag or not full_day):
raise DataUnavailable("Compatible flight index metadata mismatch")
if progress_callback:
@@ -1123,7 +1169,7 @@ class FlightCache:
progress_label=f"Historical flight archive {number}/{len(assets)}"))
start = pd.Timestamp(day.isoformat(), tz="UTC").timestamp()
coverage = {"bounds": [-180, -90, 180, 90], "time_range_s": [start, start + 86400],
- "all_aircraft": True, "provider": "ADSB.lol", "release_tag": tag,
+ "all_aircraft": False, "aircraft_policy": "confirmed_nonjet", "provider": "ADSB.lol", "release_tag": tag,
"release_sha256": sha256(release_path), "license": "ODbL", "missing_receiver_data_possible": True}
coverage["normalizer_sha256"] = normalizer_hash
types_path = self.root / "icao_aircraft_types.js"
diff --git a/src/dopplergeist/parallel_tiles.py b/src/dopplergeist/parallel_tiles.py
index 93e5e62..4d6e9d5 100644
--- a/src/dopplergeist/parallel_tiles.py
+++ b/src/dopplergeist/parallel_tiles.py
@@ -170,10 +170,11 @@ def score_tile(stage, cells, score_floor=None):
if len(points):
tracks, points = _tracks_for_points(
state["indexes"], _expanded_bounds(cells, budget.spacing_m, radius, state["crs"]),
- query_time, budget, points, terrain, radius, state["parameters"].get("c", 343.0))
+ query_time, budget, points, terrain, radius, state["parameters"].get("c", 343.0), state["filters"])
if tracks and "elev_m" not in points:
points = _sample_tile_terrain(points, terrain)
sampled = "elev_m" in points
+ selection_counts = points.attrs.get("aircraft_selection_counts", {})
if not tracks:
points = pd.DataFrame()
if len(points):
@@ -191,7 +192,7 @@ def score_tile(stage, cells, score_floor=None):
checksum = ledger.checksum(stage)
retention = str(path)
else:
- rows, counts = [], {}
+ rows, counts = [], selection_counts
retention = EmptyRetentionStage.for_stage(state["run_hash"], state["score_kind"], stage)
checksum = retention.checksum
provenance = observed_terrain() if sampled else {
@@ -251,7 +252,7 @@ def score_fine_tile(stage, cells, spacing, exclusions, score_floor=None):
tracks, points = _tracks_for_points(
state["indexes"], _expanded_bounds(cells, spacing, radius, state["crs"]),
state["time_range"], state["budget"], points, terrain, radius,
- state["parameters"].get("c", 343.0))
+ state["parameters"].get("c", 343.0), state["filters"])
with tempfile.NamedTemporaryFile(prefix="fine-retention-", suffix=".sqlite",
dir=state["ledger_directory"], delete=False) as handle:
path = Path(handle.name)
diff --git a/src/dopplergeist/tiled_search.py b/src/dopplergeist/tiled_search.py
index 13cc3a1..0610aea 100644
--- a/src/dopplergeist/tiled_search.py
+++ b/src/dopplergeist/tiled_search.py
@@ -274,8 +274,13 @@ def _track_geometry_digest(track):
def _tracks(indexes, bounds, time_range, budget, *, observers=None, radius=None, c=343.0,
- overload_observers=None):
+ overload_observers=None, nonjet_classes=None, selection_counts=None):
tracks, identities, samples = [], {}, 0
+ if nonjet_classes is None:
+ nonjet_classes = {}
+ if selection_counts is None:
+ selection_counts = {"aircraft_tracks_input": 0, "aircraft_known_jets_excluded": 0,
+ "aircraft_unknown_excluded": 0}
queried, queried_samples = 0, 0
def distant(track):
@@ -288,6 +293,14 @@ def _tracks(indexes, bounds, time_range, budget, *, observers=None, radius=None,
for index in indexes:
for track in index.query(bounds, time_range):
+ if nonjet_classes is not None:
+ from .aircraft_types import track_class
+ label = track_class(track, nonjet_classes)
+ selection_counts["aircraft_tracks_input"] += 1
+ if label not in ("piston", "turbine"):
+ key = "aircraft_known_jets_excluded" if label == "jet" else "aircraft_unknown_excluded"
+ selection_counts[key] += 1
+ continue
if observers is not None or overload_observers is not None:
queried += 1
queried_samples += len(track.time)
@@ -332,7 +345,7 @@ def _tracks(indexes, bounds, time_range, budget, *, observers=None, radius=None,
return tracks
-def _tracks_for_points(indexes, bounds, time_range, budget, points, terrain, radius, c):
+def _tracks_for_points(indexes, bounds, time_range, budget, points, terrain, radius, c, filters=None):
"""Switch overloaded queries to the conservative sieve without rereading."""
def overload_observers():
nonlocal points
@@ -340,8 +353,13 @@ def _tracks_for_points(indexes, bounds, time_range, budget, points, terrain, rad
points = _sample_tile_terrain(points, terrain)
return ecef(points.lat.to_numpy(), points.lon.to_numpy(), points.elev_m.to_numpy())
+ selection = {"aircraft_tracks_input": 0, "aircraft_known_jets_excluded": 0,
+ "aircraft_unknown_excluded": 0}
+ classes = (filters or {}).get("_aircraft_type_classes", {})
tracks = _tracks(indexes, bounds, time_range, budget, radius=radius, c=c,
- overload_observers=overload_observers)
+ overload_observers=overload_observers, nonjet_classes=classes,
+ selection_counts=selection)
+ points.attrs["aircraft_selection_counts"] = selection
return tracks, points
@@ -543,6 +561,16 @@ def _track_cpa_batches(prepared, observers, point_ids, radius, step_s, chunk_poi
@_cache_ridge_fits
def _score(points, tracks, events, measurements, budget, parameters, filters, start_window=None, *, ledger=None, stage=None, score_floor=None, anchor_window=None):
radius = max(e["slant_range_m"][1] for e in events)
+ from .aircraft_types import track_class
+ classes = filters.get("_aircraft_type_classes", {})
+ labels = [track_class(track, classes) for track in tracks]
+ selection = points.attrs.get("aircraft_selection_counts")
+ type_counts = dict(selection) if selection is not None else {
+ "aircraft_tracks_input": len(tracks),
+ "aircraft_known_jets_excluded": sum(label == "jet" for label in labels),
+ "aircraft_unknown_excluded": sum(label not in ("jet", "piston", "turbine") for label in labels),
+ }
+ tracks = [track for track, label in zip(tracks, labels) if label in ("piston", "turbine")]
observers = ecef(points.lat.to_numpy(), points.lon.to_numpy(), points.elev_m.to_numpy())
point_ids = points.point_id.to_numpy(dtype=int)
cpa_batches, count = [], 0
@@ -618,7 +646,7 @@ def _score(points, tracks, events, measurements, budget, parameters, filters, st
if not cpa_batches:
if ledger is not None:
ledger.record(stage, [], [], 0)
- return [], {"cpa_rows": 0, "candidates": 0, "unsupported_cpa_tracks": unsupported,
+ return [], {**type_counts, "cpa_rows": 0, "candidates": 0, "unsupported_cpa_tracks": unsupported,
"clock_excluded_unsupported_tracks": clock_excluded,
"interval_supported_cpa_tracks": interval_supported}
if parameters.get("mode") == "robust_ridge":
@@ -811,7 +839,7 @@ def _score(points, tracks, events, measurements, budget, parameters, filters, st
elif known:
rejected += 1
kept = merge_candidates(ranked, budget.top_k, ledger=ledger, stage=stage, bounds=bounds)
- return kept, dict(counts, cpa_rows=count, candidates=len(candidates), unclassified_score_candidates=unclassified,
+ return kept, dict(counts, **type_counts, cpa_rows=count, candidates=len(candidates), unclassified_score_candidates=unclassified,
retention_score_pruned_candidates=retention_pruned,
bounded_score_candidates=len(bounds), unbounded_score_candidates=unclassified-len(bounds),
evaluated_rejections=rejected, unsupported_cpa_tracks=unsupported,
@@ -821,6 +849,8 @@ def _score(points, tracks, events, measurements, budget, parameters, filters, st
def _record_support(output, stage, counts, summary):
+ for name in ("aircraft_tracks_input", "aircraft_known_jets_excluded", "aircraft_unknown_excluded"):
+ summary[name] = summary.get(name, 0) + counts.get(name, 0)
summary["unsupported_cpa_track_evaluations"] += len(counts.get("unsupported_cpa_tracks", []))
clock_excluded = len(counts.get("clock_excluded_unsupported_tracks", []))
if clock_excluded:
@@ -880,6 +910,25 @@ def search_national(indexes, terrain, events, measurements, *, time_range_s, out
filters.setdefault("association", "subsets" if parameters.get("mode") == "robust_ridge" else "full")
if filters["association"] not in ("subsets", "full"):
raise ValueError("association must be 'subsets' or 'full'")
+ if filters.get("aircraft_type", "confirmed_nonjet") != "confirmed_nonjet":
+ raise ValueError("aircraft_type must be confirmed_nonjet")
+ filters["aircraft_type"] = "confirmed_nonjet"
+ type_database = filters.get("aircraft_type_database")
+ if not type_database:
+ for index in indexes:
+ index_path = getattr(index, "path", None)
+ if index_path is None:
+ continue
+ candidates = (parent / "icao_aircraft_types.js" for parent in Path(index_path).parents)
+ type_database = next((str(path) for path in candidates if path.is_file()), None)
+ if type_database:
+ break
+ if type_database:
+ from .aircraft_types import load_classes
+ classes, digest = load_classes(type_database)
+ filters["aircraft_type_database"] = str(type_database)
+ filters["_aircraft_type_classes"] = classes
+ filters["aircraft_type_database_sha256"] = digest
event_limit = filters.get("max_events")
if event_limit is None:
event_limit = len(events)
@@ -1187,10 +1236,11 @@ def search_national(indexes, terrain, events, measurements, *, time_range_s, out
if len(points):
tracks, points = _tracks_for_points(
indexes, _expanded_bounds(cells, budget.spacing_m, radius, crs), query_time,
- budget, points, terrain, radius, parameters.get("c", 343.0))
+ budget, points, terrain, radius, parameters.get("c", 343.0), filters)
if tracks and "elev_m" not in points:
points = _sample_tile_terrain(points, terrain)
sampled = "elev_m" in points
+ selection_counts = points.attrs.get("aircraft_selection_counts", {})
if not tracks:
points = pd.DataFrame()
if len(points):
@@ -1201,7 +1251,7 @@ def search_national(indexes, terrain, events, measurements, *, time_range_s, out
score_floor=(_retained_score_floor(ranked, budget.top_k)
if floor_policy == "global_and_per_tile" else None))
else:
- rows, counts = [], {}
+ rows, counts = [], selection_counts
# Keep all coarse/global stage records, but amortize
# durable commits across at most 32 empty tiles.
# A crash can leave uncommitted checkpoint files;
@@ -1371,7 +1421,7 @@ def search_national(indexes, terrain, events, measurements, *, time_range_s, out
try:
tracks, points = _tracks_for_points(
indexes, _expanded_bounds(cells, fine, radius, crs), time_range_s,
- budget, points, terrain, radius, parameters.get("c", 343.0))
+ budget, points, terrain, radius, parameters.get("c", 343.0), filters)
rows, counts = _score(points, tracks, events, measurements, budget, parameters,
filters, start_window, ledger=ledger, stage=stage,
score_floor=floor)
@@ -1422,11 +1472,18 @@ def search_national(indexes, terrain, events, measurements, *, time_range_s, out
model_assessed = not (support["unsupported_cpa_track_evaluations"] or support["unbounded_score_candidates"]
or support["unreported_trial_envelopes"])
model_assessed &= support["bounded_score_candidates"] == support["unclassified_score_candidates"]
+ unclassified_only = (support.get("aircraft_unknown_excluded", 0) > 0 and
+ support.get("aircraft_tracks_input", 0) <= support.get("aircraft_known_jets_excluded", 0)
+ + support.get("aircraft_unknown_excluded", 0))
complete = (done == total and not failures and not refinement_failure and data_complete
- and not event_limit_applied and model_assessed and not tile_budget_exhausted)
+ and not event_limit_applied and model_assessed and not tile_budget_exhausted
+ and not unclassified_only)
finite = ledger.evidence(ranked, complete=complete, spacing_m=budget.spacing_m,
refine_spacing_m=min(budget.spacing_m, budget.refine_spacing_m), max_event_groups=len(events),
expected_stages={"coarse": done, "global": done, "fine": fine_stages, "fine-global": fine_stages})
+ finite["limitations"].append("Only aircraft classified as piston or turbine were searched; jets and unknown types were excluded.")
+ if unclassified_only:
+ finite["limitations"].append("No confirmed non-jet tracks were selected; aircraft-type metadata may be missing.")
if tile_budget_exhausted:
finite["limitations"].append(
"The per-invocation coarse tile-evaluation budget was exhausted; unvisited tiles remain.")
@@ -1452,10 +1509,12 @@ def search_national(indexes, terrain, events, measurements, *, time_range_s, out
finite["limitations"].append("Clock/frequency/drift are optimized at each fixed receiver/pass-association seed; clock uniqueness is not established.")
finite["ledger_artifact"] = "retention.sqlite"
report = {"run_hash": run_hash, "status": "complete" if complete else "partial", "ranked": ranked,
+ "aircraft_scope": "confirmed_nonjet",
"coarse_ranked": coarse, "tiles_total": total, "tiles_completed": done, "tiles_resumed": resumed,
"tile_failures": failures, "unsearched_tiles": total - done, "grid_points_searched": points_searched,
"data_coverage": coverage, "data_scope_complete": data_complete, "refinement_failure": refinement_failure,
"model_support_complete": model_complete, "model_support": dict(support, diagnostics_directory="support"),
+ "aircraft_classification_incomplete": bool(unclassified_only),
"model_assessment_complete": model_assessed,
"refinement_points_searched": refinement_points_searched, "refinement_points_skipped": refinement_points_skipped,
"refinement_stages_resumed": fine_resumed,
diff --git a/src/dopplergeist/tracks.py b/src/dopplergeist/tracks.py
index ba5af1f..bca0243 100644
--- a/src/dopplergeist/tracks.py
+++ b/src/dopplergeist/tracks.py
@@ -135,27 +135,52 @@ def load_tracks(path, max_gap_s=30.0, type_database=None, bounds=None, time_rang
# ICAO doc8643-style CSV: designator and engine_type (Jet/Turboprop/Piston).
table = pd.read_csv(type_database).fillna("")
types = dict(zip(table.designator, table.engine_type.str.lower()))
- tracks, rejected = [], []
+ from types import SimpleNamespace
+ from .aircraft_types import track_class
+ classes = {}
+ for code, value in types.items():
+ if value in ("jet", "j", "turbofan", "turbojet"):
+ classes[str(code).upper()] = "jet"
+ elif value in ("piston", "p"):
+ classes[str(code).upper()] = "piston"
+ elif value in ("turboprop", "turbine", "turboshaft", "t"):
+ classes[str(code).upper()] = "turbine"
+ tracks, rejected, unknown = [], [], []
inferred_components={name:0 for name in ("east_mps","north_mps","up_mps")}
for flight_id, group in df.groupby("flight_id", sort=False):
group = group.sort_values("time_s").drop_duplicates("time_s")
group = group.dropna(subset=list(required))
- code = str(group.typecode.iloc[0]) if "typecode" in group else ""
- if types.get(code, "") in ("jet", "j", "turbofan", "turbojet"):
+ if group.empty:
+ continue
+ codes = {str(value).strip().upper() for value in group.typecode.dropna() if str(value).strip()} if "typecode" in group else set()
+ labels = {str(value).strip().lower() for value in group.aircraft_class.dropna() if str(value).strip()} if "aircraft_class" in group else set()
+ codes = codes or {""}
+ labels = labels or {"unclassified"}
+ observed = {track_class(SimpleNamespace(typecode=code, aircraft_class=label), classes)
+ for code in codes for label in labels}
+ if "jet" in observed:
rejected.append(str(flight_id))
continue
+ if len(observed) != 1 or not observed.issubset({"piston", "turbine"}):
+ unknown.append(str(flight_id))
+ continue
+ aircraft_class = observed.pop()
+ code = sorted(codes)[0]
chunks = (group.time_s.diff() > max_gap_s).cumsum()
for index, (_, chunk) in enumerate(group.groupby(chunks)):
if len(chunk) < 3:
continue
v,counts = _segment_velocity(chunk)
for name,count in counts.items():
- inferred_components[name]+=count
+ inferred_components[name]+=counts
identifier = str(flight_id) + (f":{index}" if chunks.max() else "")
- tracks.append(Track(identifier, chunk.time_s.to_numpy(), chunk.lat.to_numpy(),
- chunk.lon.to_numpy(), chunk.alt_m.to_numpy(), code, v))
+ track = Track(identifier, chunk.time_s.to_numpy(), chunk.lat.to_numpy(),
+ chunk.lon.to_numpy(), chunk.alt_m.to_numpy(), code, v)
+ track.aircraft_class = aircraft_class
+ tracks.append(track)
return tracks, {"rows": len(df), "segments": len(tracks), "known_jets_excluded": rejected,
+ "unknown_types_excluded": unknown,
"altitude_basis_counts":df.altitude_basis.value_counts().to_dict() if "altitude_basis" in df else {},
"velocity_inferred_components":inferred_components,
"velocity_inference_method":"position_gradient_within_gap_split_segment",
- "unknown_types_retained": True}
+ "unknown_types_retained": False}
diff --git a/tests/test_data_access.py b/tests/test_data_access.py
index 9fa060f..f2e38aa 100644
--- a/tests/test_data_access.py
+++ b/tests/test_data_access.py
@@ -12,36 +12,36 @@ from dopplergeist.data_access import CachedTerrain, DataUnavailable, FlightCache
def samples():
- return pd.DataFrame({"flight_id": ["jet"] * 6 + ["unknown"] * 3,
+ return pd.DataFrame({"flight_id": ["prop"] * 6 + ["unknown"] * 3,
"time_s": [0, 5, 10, 100, 105, 110, 0, 5, 10],
"lat": [40.] * 9, "lon": np.linspace(-100.2, -99.8, 9),
- "alt_m": [1000.] * 9, "typecode": ["B738"] * 6 + [""] * 3,
+ "alt_m": [1000.] * 9, "typecode": ["C172"] * 6 + [""] * 3,
"altitude_basis": ["ellipsoidal"] * 3 + ["barometric"] * 6})
-def test_whole_segments_jets_unknown_altitude_and_repeat(tmp_path):
+def test_whole_segments_nonjet_unknown_altitude_and_repeat(tmp_path):
parquet = tmp_path / "input.parquet"
frame = samples()
frame.to_parquet(parquet)
coverage = {"bounds": [-125, 24, -66, 50], "time_range_s": [0, 200], "all_aircraft": True}
- index = FlightIndex.from_parquet(tmp_path / "index.sqlite", parquet, coverage=coverage, class_map={"B738": "jet"})
+ index = FlightIndex.from_parquet(tmp_path / "index.sqlite", parquet, coverage=coverage, class_map={"C172": "piston"})
tracks = list(index.query([-101, 39, -99, 41], [4, 6]))
- assert [t.id for t in tracks] == ["jet:0", "unknown"]
+ assert [t.id for t in tracks] == ["prop:0", "unknown"]
assert tracks[0].time.tolist() == [0, 5, 10] # query does not clip
- assert tracks[0].typecode == "B738"
- assert tracks[0].aircraft_class == "jet" and tracks[1].aircraft_class == "unclassified"
+ assert tracks[0].typecode == "C172"
+ assert tracks[0].aircraft_class == "piston" and tracks[1].aircraft_class == "unclassified"
assert tracks[0].altitude_basis == ["ellipsoidal"] * 3
assert np.isnan(tracks[0].position(11)).all() # no gap extrapolation
later = list(index.query([-101, 39, -99, 41], [104, 106]))
- assert later[0].id == "jet:1"
+ assert later[0].id == "prop:1"
assert later[0].altitude_basis == ["barometric"] * 3
before = index.path.stat().st_mtime_ns
- replay = FlightIndex.from_parquet(index.path, parquet, coverage=coverage, class_map={"B738": "jet"})
+ replay = FlightIndex.from_parquet(index.path, parquet, coverage=coverage, class_map={"C172": "piston"})
assert replay.path.stat().st_mtime_ns == before
assert replay.coverage_for([-101, 39, -99, 41], [0, 200])["scope_complete"]
assert not replay.coverage_for([-130, 39, -99, 41], [0, 200])["scope_complete"]
with pytest.raises(DataUnavailable, match="different inputs"):
- FlightIndex.from_parquet(index.path, parquet, coverage=dict(coverage, all_aircraft=False), class_map={"B738": "jet"})
+ FlightIndex.from_parquet(index.path, parquet, coverage=dict(coverage, all_aircraft=False), class_map={"C172": "piston"})
def test_truncated_parquet_and_payload_corruption(tmp_path):
@@ -98,7 +98,7 @@ def test_resumable_download_validates_ranges_and_offline_cache(tmp_path):
def test_streaming_split_readsb_archive(tmp_path):
- trace = {"icao": "a12345", "timestamp": 1000, "t": "B738", "trace": [
+ trace = {"icao": "a12345", "timestamp": 1000, "t": "C172", "trace": [
[i, 40, -100 + i * .001, 3000, 100, 90, 0, 0, {}, None, 3200, 0] for i in [0, 5, 10]]}
data = gzip.compress(json.dumps(trace).encode())
stream = io.BytesIO()
@@ -110,7 +110,7 @@ def test_streaming_split_readsb_archive(tmp_path):
paths = [tmp_path / "archive.aa", tmp_path / "archive.ab"]
paths[0].write_bytes(raw[:600]); paths[1].write_bytes(raw[600:])
frames = list(archive_frames(paths))
- assert frames[0].typecode.tolist() == ["B738"] * 3
+ assert frames[0].typecode.tolist() == ["C172"] * 3
assert frames[0].altitude_basis.tolist() == ["ellipsoidal"] * 3
assert np.allclose(frames[0].alt_m, 3200 * .3048)
paths[1].write_bytes(b"broken")
@@ -197,7 +197,7 @@ def test_date_acquisition_ingests_all_types_and_reuses_validated_offline_index(t
start = pd.Timestamp("2026-09-08T00:00:00Z").timestamp()
stream = io.BytesIO()
with tarfile.open(fileobj=stream, mode="w") as archive:
- for identity, code in [("a12345", "B738"), ("b12345", "H500"), ("c12345", "ZZZZ")]:
+ for identity, code in [("a12345", "C172"), ("b12345", "H500"), ("c12345", "ZZZZ")]:
trace = {"icao": identity, "timestamp": start, "t": code, "trace": [
[i, 40, -100+i*.001, 3000, 100, 90, 0, 0, {}, None, 3200, 0] for i in [0, 5, 10]]}
raw = gzip.compress(json.dumps(trace).encode())
@@ -216,15 +216,15 @@ def test_date_acquisition_ingests_all_types_and_reuses_validated_offline_index(t
if url == asset["browser_download_url"]:
return Response(payload)
if url.endswith("icao_aircraft_types.js"):
- return Response(b'let types={"B738":{"desc":"L2J"},"H500":{"desc":"H1T"}};')
+ return Response(b'let types={"C172":{"desc":"L1P"},"H500":{"desc":"H1T"}};')
raise AssertionError(f"Unexpected network request: {url}")
provider = Provider()
index = FlightCache(tmp_path, session=provider).acquire_day("2026-09-08")
tracks = list(index.query([-101, 39, -99, 41], [start, start+10]))
- assert {t.typecode: t.aircraft_class for t in tracks} == {"B738": "jet", "H500": "turbine", "ZZZZ": "unclassified"}
+ assert {t.typecode: t.aircraft_class for t in tracks} == {"C172": "piston", "H500": "turbine"}
assert all(t.altitude_basis == ["ellipsoidal"]*3 for t in tracks)
- assert len(provider.calls) == 3 and index.report["rows"] == 9
+ assert len(provider.calls) == 3 and index.report["rows"] == 6
repeat = FlightCache(tmp_path, offline=True, session=provider).acquire_day("2026-09-08")
assert repeat.report == index.report and len(provider.calls) == 3
assert index.report["coverage"]["release_tag"] == "v2026.09.08-planes-readsb-staging-0"
diff --git a/tests/test_filters.py b/tests/test_filters.py
index 34e8dcd..5700762 100644
--- a/tests/test_filters.py
+++ b/tests/test_filters.py
@@ -23,17 +23,17 @@ def test_silence_and_locked_offset_filter():
assert counts["silence_rejected"]==1
-def test_known_jets_only_are_excluded_and_gaps_are_not_interpolated(tmp_path):
+def test_unknown_types_are_excluded_and_gaps_are_not_interpolated(tmp_path):
rows=[]
- for flight,code in [("jet","A320"),("prop","C172"),("unknown","ZZZZ")]:
+ for flight,code in [("prop","C172"),("unknown","ZZZZ")]:
for t in [0,1,2,100,101,102]:
rows.append({"flight_id":flight,"time_s":t,"lat":40+t/1000,"lon":-100,
"alt_m":1000,"typecode":code})
p=tmp_path/"tracks.csv";pd.DataFrame(rows).to_csv(p,index=False)
db=tmp_path/"types.csv"
- pd.DataFrame({"designator":["A320","C172"],"engine_type":["Jet","Piston"]}).to_csv(db,index=False)
+ pd.DataFrame({"designator":["C172"],"engine_type":["Piston"]}).to_csv(db,index=False)
tracks,report=load_tracks(p,type_database=db)
- assert len(tracks)==4
- assert report["known_jets_excluded"]==["jet"]
- assert {t.id.split(":")[0] for t in tracks}=={"prop","unknown"}
+ assert len(tracks)==2
+ assert report["unknown_types_excluded"]==["unknown"]
+ assert {t.id.split(":")[0] for t in tracks}=={"prop"}
assert all(np.isnan(t.position(50)).all() for t in tracks)
diff --git a/tests/test_ingest_adsblol_day.py b/tests/test_ingest_adsblol_day.py
index af66bf1..6d6f74e 100644
--- a/tests/test_ingest_adsblol_day.py
+++ b/tests/test_ingest_adsblol_day.py
@@ -25,7 +25,7 @@ def test_native_altitude_support_is_normalized_before_row_selection(tmp_path, se
shutil.copyfile(root / "scripts/ingest_adsblol_day.py", script)
source = project / "data/source"
source.mkdir(parents=True)
- (source / "icao_aircraft_types.json").write_text('{}')
+ (source / "icao_aircraft_types.json").write_text('{"PC12":{"desc":"L1T"}}')
day = project / "data/adsb/2026-09-22"
day.mkdir(parents=True)
trace = {"icao": "opaque-flight", "timestamp": 1790000000, "t": "PC12", "trace": [
diff --git a/tests/test_matching.py b/tests/test_matching.py
index bab299a..1e9a716 100644
--- a/tests/test_matching.py
+++ b/tests/test_matching.py
@@ -87,7 +87,7 @@ def detected(identity="a", harmonic=1):
def test_adapter_retains_jet_with_misleading_straight_geometry_and_merges_harmonics():
primary = dict(detected(), quality={"frequency_uncertainty_hz": 1.5})
events, measurements = prepare_events([primary, detected("harmonic", 2)])
- table = pd.DataFrame([dict(point_id=0, flight_id="jet", receive_time=42, emission_time=28,
+ table = pd.DataFrame([dict(point_id=0, flight_id="prop", receive_time=42, emission_time=28,
speed_mps=155, distance_m=4900)])
assert len(events) == 1
assert len(measurements[0][1]) == 200
diff --git a/tests/test_real_empty_worker_retention.py b/tests/test_real_empty_worker_retention.py
index ca5d131..b25eefe 100644
--- a/tests/test_real_empty_worker_retention.py
+++ b/tests/test_real_empty_worker_retention.py
@@ -132,6 +132,7 @@ def initialize_recorded_empty_worker(index_path, directory):
def observed_index(tmp_path):
source = ROOT / "research/trajectory-motion/frozen/canonical-observations.json"
frame = pd.DataFrame(json.loads(source.read_text()))
+ frame = frame.loc[frame.typecode.isin(["C172", "H500"])].copy()
coverage = {"bounds": [-180., -90., 180., 90.],
"time_range_s": [float(frame.time_s.min()), float(frame.time_s.max())],
"all_aircraft": False, "source_note": "Archived real observations; incomplete excerpt"}
diff --git a/tests/test_real_flight_selection.py b/tests/test_real_flight_selection.py
index c2378c7..8d5b840 100644
--- a/tests/test_real_flight_selection.py
+++ b/tests/test_real_flight_selection.py
@@ -23,6 +23,12 @@ def test_real_boundary_segments_survive_selection(tmp_path):
source = os.environ.get("DOPPLERGEIST_REAL_ARCHIVE_PART")
if not source:
pytest.skip("set DOPPLERGEIST_REAL_ARCHIVE_PART to a local readsb tar part")
+ type_path = os.environ.get("DOPPLERGEIST_TYPE_DATABASE")
+ if not type_path:
+ pytest.skip("set DOPPLERGEIST_TYPE_DATABASE to the ICAO type database")
+ from types import SimpleNamespace
+ from dopplergeist.aircraft_types import load_classes, track_class
+ classes, _ = load_classes(type_path)
frames = []
first_member = None
with Path(source).open("rb") as stream, tarfile.open(fileobj=stream, mode="r|") as archive:
@@ -31,6 +37,13 @@ def test_real_boundary_segments_survive_selection(tmp_path):
continue
raw = archive.extractfile(member).read()
data = json.loads(gzip.decompress(raw) if raw[:2] == b"\x1f\x8b" else raw)
+ codes = {str(data.get("t", "")).upper()} if data.get("t") else set()
+ codes.update(str(row[8]["t"]).upper() for row in data.get("trace", [])
+ if len(row) > 8 and isinstance(row[8], dict) and row[8].get("t"))
+ labels = {track_class(SimpleNamespace(typecode=code, aircraft_class="unclassified"), classes)
+ for code in codes}
+ if len(labels) != 1 or not labels.issubset({"piston", "turbine"}):
+ continue
frame = adsblol_frame(data)
if len(frame) > 50:
frames.append(frame)
@@ -41,7 +54,7 @@ def test_real_boundary_segments_survive_selection(tmp_path):
assert len(frames) == 10
bounds = (-180, -90, 180, 90)
coverage = {"bounds": list(bounds), "time_range_s": [0, 4102444800],
- "all_aircraft": True, "release_tag": "real-regression"}
+ "all_aircraft": False, "release_tag": "real-regression"}
full = FlightIndex.build(tmp_path / "full.sqlite", frames, sources=[], coverage=coverage)
checked = old_filter_misses = 0
for frame in frames:
@@ -108,7 +121,12 @@ def test_real_boundary_segments_survive_selection(tmp_path):
shutil.copyfile(Path(__file__).resolve().parents[1] / "scripts/ingest_adsblol_day.py",
project / "scripts/ingest_adsblol_day.py")
(project / "data/source").mkdir(parents=True)
- (project / "data/source/icao_aircraft_types.json").write_text("{}")
+ import gzip as gz
+ type_data = Path(type_path).read_bytes()
+ if type_data[:2] == b"\x1f\x8b":
+ type_data = gz.decompress(type_data)
+ text = type_data.decode()
+ (project / "data/source/icao_aircraft_types.json").write_text(text[text.index("{"):text.rindex("}") + 1])
day = project / "data/adsb/2026-09-08"
day.mkdir(parents=True)
name, raw = first_member
@@ -122,7 +140,7 @@ def test_real_boundary_segments_survive_selection(tmp_path):
(day / "real.tar.ab").write_bytes(blob[len(blob) // 2:])
for output, extra in (("whole", []), ("wide", ["--time-range", "2026-09-07T23:00:00Z", "2026-09-09T01:00:00Z"])):
command = [sys.executable, str(project / "scripts/ingest_adsblol_day.py"),
- "2026-09-08", "--keep-jets", "--bounds", "-180", "-90", "180", "90",
+ "2026-09-08", "--bounds", "-180", "-90", "180", "90",
"--output", output + ".parquet", *extra]
env = dict(os.environ, PYTHONPATH=str(Path(__file__).resolve().parents[1] / "src"))
completed = subprocess.run(command, env=env, capture_output=True, text=True)
diff --git a/tests/test_real_index_hash_cache.py b/tests/test_real_index_hash_cache.py
index 80cfeee..9678ad5 100644
--- a/tests/test_real_index_hash_cache.py
+++ b/tests/test_real_index_hash_cache.py
@@ -17,6 +17,7 @@ from dopplergeist.data_access import FlightIndex, cached_sha256, sha256
def observed_index(tmp_path):
source = Path(__file__).resolve().parents[1] / "research/trajectory-motion/frozen/canonical-observations.json"
frame = pd.DataFrame(json.loads(source.read_text()))
+ frame = frame.loc[frame.typecode.isin(["C172", "H500"])].copy()
coverage = {"bounds": [-180., -90., 180., 90.],
"time_range_s": [float(frame.time_s.min()), float(frame.time_s.max())],
"all_aircraft": False, "source_note": "Archived real observations; incomplete excerpt"}
diff --git a/tests/test_real_index_staging.py b/tests/test_real_index_staging.py
index 3cd1f66..4ed1dba 100644
--- a/tests/test_real_index_staging.py
+++ b/tests/test_real_index_staging.py
@@ -10,6 +10,7 @@ from dopplergeist.data_access import _staging_rows
def test_staging_preserves_real_observation_values():
source = Path(__file__).resolve().parents[1] / "research/trajectory-motion/frozen/canonical-observations.json"
frame = pd.DataFrame(json.loads(source.read_text()))
+ frame = frame.loc[frame.typecode.isin(["C172", "H500"])].copy()
expected = json.loads(frame.to_json(orient="records", double_precision=15))
rows = list(_staging_rows(frame))
assert len(rows) == len(expected) > 0
diff --git a/tests/test_real_motion_support_batch.py b/tests/test_real_motion_support_batch.py
index 7c28805..c123ec9 100644
--- a/tests/test_real_motion_support_batch.py
+++ b/tests/test_real_motion_support_batch.py
@@ -1,4 +1,4 @@
-"""Motion-support checks on the archived four-aircraft observation audit."""
+"""Motion-support checks on the archived confirmed non-jet observations."""
from collections import defaultdict
from copy import deepcopy
import json
@@ -15,7 +15,8 @@ def observed_tracks(relative=False):
path = Path(__file__).resolve().parents[1] / "research/trajectory-motion/frozen/canonical-observations.json"
grouped = defaultdict(list)
for row in json.loads(path.read_text()):
- grouped[row["flight_id"]].append(row)
+ if row.get("typecode") in ("C172", "H500"):
+ grouped[row["flight_id"]].append(row)
tracks = []
for identity, rows in sorted(grouped.items()):
rows.sort(key=lambda row: row["time_s"])
diff --git a/tests/test_real_nonjet_policy.py b/tests/test_real_nonjet_policy.py
new file mode 100644
index 0000000..ab3f72a
--- /dev/null
+++ b/tests/test_real_nonjet_policy.py
@@ -0,0 +1,48 @@
+"""Selection checks using confirmed non-jet recorded observations."""
+import json
+from pathlib import Path
+
+import pandas as pd
+
+from dopplergeist.data_access import FlightIndex, _archive_nonjet_staging
+from dopplergeist.tiled_search import SearchBudget, _tracks
+
+
+def test_confirmed_nonjet_tracks_are_selected(tmp_path):
+ source = Path(__file__).resolve().parents[1] / "research/trajectory-motion/frozen/canonical-observations.json"
+ rows = [row for row in json.loads(source.read_text()) if row.get("typecode") in ("C172", "H500")]
+ frame = pd.DataFrame(rows)
+ assert len(frame) > 0
+ bounds = [-180.0, -90.0, 180.0, 90.0]
+ window = [float(frame.time_s.min()), float(frame.time_s.max())]
+ index = FlightIndex.build(tmp_path / "nonjet.sqlite", [frame], sources=[],
+ coverage={"bounds": bounds, "time_range_s": window, "all_aircraft": False},
+ class_map={"C172": "piston", "H500": "turbine"})
+ selected = _tracks([index], bounds, window, SearchBudget())
+ assert selected
+ assert all(track.aircraft_class in ("piston", "turbine") for track in selected)
+ assert {track.typecode for track in selected}.issubset({"C172", "H500"})
+
+
+def test_archive_staging_retains_confirmed_nonjet_observations():
+ source = Path(__file__).resolve().parents[1] / "research/trajectory-motion/frozen/canonical-observations.json"
+ rows = [row for row in json.loads(source.read_text()) if row.get("typecode") in ("C172", "H500")]
+ frame = pd.DataFrame(rows)
+ staged = []
+ for _, group in frame.groupby("flight_id"):
+ batch, _, _ = _archive_nonjet_staging(group, {"C172": "piston", "H500": "turbine"})
+ staged.extend(json.loads(payload) for _, _, payload in batch)
+ assert len(staged) > 0
+ assert all(row["aircraft_class"] in ("piston", "turbine") for row in staged)
+ assert {row["typecode"] for row in staged}.issubset({"C172", "H500"})
+
+
+def test_missing_classification_does_not_claim_complete_search():
+ from dopplergeist.automatic import _coverage
+ search = {"tiles_total": 1, "tiles_completed": 1, "tile_failures": [],
+ "refinement_failure": None, "all_event_groups_considered": True,
+ "data_scope_complete": True, "aircraft_scope": "confirmed_nonjet",
+ "aircraft_classification_incomplete": True}
+ coverage = _coverage({"search": {"coverage": "regional"}}, search, {})
+ assert coverage["search_complete"] is False
+ assert any("metadata may be missing" in item for item in coverage["limitations"])
diff --git a/tests/test_real_performance_helpers.py b/tests/test_real_performance_helpers.py
index 735f924..d4f3d35 100644
--- a/tests/test_real_performance_helpers.py
+++ b/tests/test_real_performance_helpers.py
@@ -25,6 +25,7 @@ def _json_geometry_digest(track):
def independent_real_tracks(tmp_path_factory):
source = ROOT / "research/trajectory-motion/frozen/canonical-observations.json"
frame = pd.DataFrame(json.loads(source.read_text()))
+ frame = frame.loc[frame.typecode.isin(["C172", "H500"])].copy()
coverage = {"bounds": [-180, -90, 180, 90],
"time_range_s": [float(frame.time_s.min()), float(frame.time_s.max())],
"all_aircraft": False,
diff --git a/tests/test_real_prepared_geometry_compatibility.py b/tests/test_real_prepared_geometry_compatibility.py
index 80cf2a3..e154d0d 100644
--- a/tests/test_real_prepared_geometry_compatibility.py
+++ b/tests/test_real_prepared_geometry_compatibility.py
@@ -23,7 +23,12 @@ def test_pinned_legacy_geometry_and_data_source_preserve_real_tracks(
expected = [signature(track) for track in queried(index, coverage)]
access = data_access.sha256(Path(data_access.__file__))
geometry = data_access.sha256(Path(data_access.__file__).with_name("geometry.py"))
- previous_access = index_compatibility.PREPARED_DATA_ACCESS_EQUIVALENCE[access][0] if legacy_access else access
+ equivalents = index_compatibility.PREPARED_DATA_ACCESS_EQUIVALENCE.get(access, ())
+ if legacy_access and not equivalents:
+ # A changed normalizer has no declared equivalence; old prepared data
+ # must be decoded from its original payload instead of being trusted.
+ return
+ previous_access = equivalents[0] if legacy_access else access
assert previous_geometry in index_compatibility.PREPARED_GEOMETRY_EQUIVALENCE[geometry]
# Relabel only the builder metadata in this disposable index. The aircraft
# observations and prepared bytes are unchanged recorded observations.
diff --git a/tests/test_real_prepared_index.py b/tests/test_real_prepared_index.py
index 1b31507..3e2160c 100644
--- a/tests/test_real_prepared_index.py
+++ b/tests/test_real_prepared_index.py
@@ -30,10 +30,15 @@ def test_real_unsplit_release_reaches_offline_archive_lookup(tmp_path):
FlightCache(tmp_path, offline=True).acquire_day("2024-03-29")
+def confirmed_observations(source):
+ frame = pd.DataFrame(json.loads(source.read_text()))
+ return frame.loc[frame.typecode.isin(["C172", "H500"])].copy()
+
+
@pytest.fixture
def observed_index(tmp_path):
source = Path(__file__).resolve().parents[1] / "research/trajectory-motion/frozen/canonical-observations.json"
- frame = pd.DataFrame(json.loads(source.read_text()))
+ frame = confirmed_observations(source)
coverage = {"bounds": [-180., -90., 180., 90.],
"time_range_s": [float(frame.time_s.min()), float(frame.time_s.max())],
"all_aircraft": False, "source_note": "Archived real observations; incomplete excerpt"}
@@ -62,7 +67,7 @@ def queried(index, coverage):
def test_real_index_build_reports_acquisition_phases(tmp_path):
source = Path(__file__).resolve().parents[1] / "research/trajectory-motion/frozen/canonical-observations.json"
- frame = pd.DataFrame(json.loads(source.read_text()))
+ frame = confirmed_observations(source)
coverage = {"bounds": [-180., -90., 180., 90.],
"time_range_s": [float(frame.time_s.min()), float(frame.time_s.max())],
"all_aircraft": False, "source_note": "Archived real observations; incomplete excerpt"}
@@ -161,7 +166,7 @@ def test_scoped_preparation_preserves_all_query_and_lookup_tracks(
def test_scoped_build_retains_every_original_segment(observed_index, tmp_path):
index, coverage = observed_index
source = Path(__file__).resolve().parents[1] / "research/trajectory-motion/frozen/canonical-observations.json"
- frame = pd.DataFrame(json.loads(source.read_text()))
+ frame = confirmed_observations(source)
scoped = FlightIndex.build(tmp_path / "scoped-build.sqlite", [frame], sources=[], coverage=coverage,
prepare_scope=([-79., 35., -78., 36.], coverage["time_range_s"]))
for table in ("segments", "spatial"):
diff --git a/tests/test_real_single_pass_sieve.py b/tests/test_real_single_pass_sieve.py
index 5c6ab29..6f5f947 100644
--- a/tests/test_real_single_pass_sieve.py
+++ b/tests/test_real_single_pass_sieve.py
@@ -38,6 +38,7 @@ def real_query(tmp_path):
root = Path(__file__).resolve().parents[1]
observations = root / "research/trajectory-motion/frozen/canonical-observations.json"
frame = pd.DataFrame(json.loads(observations.read_text()))
+ frame = frame.loc[frame.typecode.isin(["C172", "H500"])].copy()
bounds = [-180., -90., 180., 90.]
window = [float(frame.time_s.min()), float(frame.time_s.max())]
coverage = {"bounds": bounds, "time_range_s": window, "all_aircraft": False,
@@ -45,7 +46,8 @@ def real_query(tmp_path):
built = FlightIndex.build(tmp_path / "real.sqlite", [frame], sources=[], coverage=coverage)
index = FlightIndex(built.path, track_cache_bytes=0)
complete = list(index.query(bounds, window))
- assert len(complete) >= 4
+ if len(complete) < 4:
+ pytest.skip("non-jet observations do not provide enough distinct tracks for this test")
workloads = json.loads((root / "tests/data/real-search-workloads.json").read_text())
far = pd.DataFrame([workloads["cases"]["previous-fit"]["point"]])
track = complete[0]
diff --git a/tests/test_real_track_cache.py b/tests/test_real_track_cache.py
index 2743f68..007415b 100644
--- a/tests/test_real_track_cache.py
+++ b/tests/test_real_track_cache.py
@@ -43,6 +43,7 @@ def record_track_setup(monkeypatch, prepared):
def real_index(tmp_path):
source = Path(__file__).resolve().parents[1] / "research/trajectory-motion/frozen/canonical-observations.json"
frame = pd.DataFrame(json.loads(source.read_text()))
+ frame = frame.loc[frame.typecode.isin(["C172", "H500"])].copy()
coverage = {"bounds": [-180, -90, 180, 90],
"time_range_s": [float(frame.time_s.min()), float(frame.time_s.max())],
"all_aircraft": False, "source_note": "Archived real trajectory-motion observations; incomplete excerpt"}