Skip to content

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

fix: accept unsplit historical flight archives

Cinna Davisee23896282b8
diff --git a/docs/DATA_AND_SCALE.md b/docs/DATA_AND_SCALE.md
index ae24ebf..839f294 100644
--- a/docs/DATA_AND_SCALE.md
+++ b/docs/DATA_AND_SCALE.md
@@ -13,6 +13,8 @@ obtains ADSB.lol release metadata, resumes split archive parts using checked HTT
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;
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.
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
diff --git a/src/dopplergeist/data_access.py b/src/dopplergeist/data_access.py
index 85b20c0..8450b92 100644
--- a/src/dopplergeist/data_access.py
+++ b/src/dopplergeist/data_access.py
@@ -954,9 +954,10 @@ class FlightCache:
raise DataUnavailable(f"Invalid historical release metadata: {release_path}") from error
if not isinstance(release, dict) or release.get("tag_name") != tag:
raise DataUnavailable(f"Historical release metadata does not match requested tag: {tag}")
- assets = sorted((a for a in release["assets"] if ".tar." in a["name"]), key=lambda a: a["name"])
+ assets = sorted((a for a in release["assets"] if a["name"].endswith(".tar") or ".tar." in a["name"]),
+ key=lambda a: a["name"])
if not assets:
- raise DataUnavailable("Release has no split trace archive")
+ raise DataUnavailable("Release has no trace archive")
sources = []
for asset in assets:
digest = asset.get("digest")
diff --git a/tests/test_real_prepared_index.py b/tests/test_real_prepared_index.py
index 385fbeb..2a5882b 100644
--- a/tests/test_real_prepared_index.py
+++ b/tests/test_real_prepared_index.py
@@ -10,7 +10,24 @@ import pandas as pd
import pytest
from dopplergeist import data_access
-from dopplergeist.data_access import DataUnavailable, FlightIndex
+from dopplergeist.data_access import DataUnavailable, FlightCache, FlightIndex
+
+
+def test_real_unsplit_release_reaches_offline_archive_lookup(tmp_path):
+ # Actual metadata from the ADSB.lol 2024-03-29 staging-0 release.
+ tag = "v2024.03.29-planes-readsb-staging-0"
+ name = tag + ".tar"
+ directory = tmp_path / "2024-03-29/staging-0"
+ directory.mkdir(parents=True)
+ release = {"tag_name": tag, "assets": [{
+ "name": name, "size": 1940520960,
+ "browser_download_url": f"https://github.com/adsblol/globe_history_2024/releases/download/{tag}/{name}",
+ }]}
+ (directory / "release.json").write_text(json.dumps(release))
+ # The valid release must reach the missing-file check, not be rejected as
+ # lacking a split archive. No audio, tracks or archive bytes are generated.
+ with pytest.raises(DataUnavailable, match=r"Offline cache miss: .*\.tar$"):
+ FlightCache(tmp_path, offline=True).acquire_day("2024-03-29")
@pytest.fixture