Skip to content

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

feat: support regional bounds in analyze command (#272)

Cinna Davisd51a31073c03
diff --git a/README.md b/README.md
index 0b843f1..535563e 100644
--- a/README.md
+++ b/README.md
@@ -51,6 +51,11 @@ This scans the complete recording and saves an inspectable job. To permit histor
Initial data acquisition can take hours and tens of gigabytes; [the workflow guide](docs/PRODUCT.md) covers caching, runtime limits and resuming stopped jobs.
+To limit the geographic search when you have independent regional context, add
+`--bounds WEST SOUTH EAST NORTH` in decimal degrees, for example
+`--bounds -98.98 30.29 -98.73 30.47`. The bounds are a search prior, and the
+clock window must still be supported by recording metadata or other evidence.
+
The command prints a job ID when queued. In another terminal, run
`.venv/bin/dopplergeist job JOB_ID --jobs jobs --watch` to follow reported
progress, checkpoint rate, and the age of the latest tile and job status update.
diff --git a/src/dopplergeist/cli.py b/src/dopplergeist/cli.py
index 201a40e..d3c61be 100644
--- a/src/dopplergeist/cli.py
+++ b/src/dopplergeist/cli.py
@@ -79,6 +79,8 @@ def main():
analyze.add_argument("--start-utc",help="Earliest UTC recording start, including explicit timezone")
analyze.add_argument("--end-utc",help="Latest UTC recording start; defaults to earliest")
analyze.add_argument("--time-source",help="How the recording start window was established")
+ analyze.add_argument("--bounds",type=float,nargs=4,metavar=("WEST", "SOUTH", "EAST", "NORTH"),
+ help="Limit the search to a WGS84 rectangle in decimal degrees")
analyze.add_argument("--jobs",default="jobs",help="Persistent job directory")
analyze.add_argument("--config",help="Operator provider/cache/search configuration JSON")
analyze.add_argument("--online",action="store_true",help="Download public data to the local cache; this can require tens of gigabytes and hours")
@@ -131,6 +133,8 @@ def main():
if args.end_utc and not args.start_utc:
parser.error("--end-utc requires --start-utc")
request={"schema_version":1,"search":{"coverage":"conus"}}
+ if args.bounds is not None:
+ request["search"]["bounds_wsen"]=args.bounds
if args.start_utc:
request["time_window"]={"start_utc":args.start_utc,"end_utc":args.end_utc or args.start_utc,"source":"user"}
if args.time_source:
diff --git a/tests/test_cli_regional_bounds.py b/tests/test_cli_regional_bounds.py
new file mode 100644
index 0000000..a11b1c4
--- /dev/null
+++ b/tests/test_cli_regional_bounds.py
@@ -0,0 +1,24 @@
+"""Command-line geographic argument checks without generated recordings."""
+
+import subprocess
+import sys
+from pathlib import Path
+
+
+def test_analyze_help_includes_bounded_region():
+ run = subprocess.run([sys.executable, "-m", "dopplergeist.cli", "analyze", "--help"],
+ capture_output=True, text=True, check=True)
+ assert "--bounds WEST SOUTH EAST NORTH" in run.stdout
+
+
+def test_analyze_rejects_reversed_bounds_before_creating_job(tmp_path):
+ # Request validation runs before decoding; an existing file is sufficient.
+ jobs = tmp_path / "jobs"
+ run = subprocess.run(
+ [sys.executable, "-m", "dopplergeist.cli", "analyze", str(Path(__file__)),
+ "--bounds", "-98.73", "30.29", "-98.98", "30.47", "--jobs", str(jobs)],
+ capture_output=True, text=True,
+ )
+ assert run.returncode != 0
+ assert "Bounds must be increasing" in run.stderr
+ assert not jobs.exists()