Skip to content

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

Add metropolitan France search profile including Corsica (#374)

NOctu141219d5147948c0
diff --git a/README.md b/README.md
index ed6a8de..95e6f88 100644
--- a/README.md
+++ b/README.md
@@ -30,7 +30,7 @@ Colsto did not release the original tools or source code from his [aircraft Dopp
| **Automatic acoustic discovery** | Scans an entire recording for moving frequency tracks and groups related harmonics, without manually selecting event windows or frequency bands. |
| **Historical aircraft data** | Acquires and indexes ADSB.lol flight archives; caches reusable trajectory, terrain, and geoid inputs. |
| **Location search** | Compares predicted Doppler and sound-arrival patterns across candidate receiver locations, including evidence from multiple independent flyovers. |
-| **Geographic profiles** | Search profiles for the contiguous United States, Germany, and Spain, with optional user-provided regional bounds. |
+| **Geographic profiles** | Search profiles for the contiguous United States, Germany, Spain, and metropolitan France (including Corsica), with optional user-provided regional bounds. |
| **Local browser application** | Recording uploads, persistent analysis jobs, inspectable results, progress monitoring, and supported resume/cancellation workflows. |
| **Research and reproducibility** | Configured measurement/replay commands, documented experiments, diagnostic artifacts, and decision rules for unresolved searches. |
@@ -85,7 +85,7 @@ To check progress after the job ID is printed:
The progress percentage is stage-based and can remain unchanged during long tile subdivisions. Recent search-file activity is a liveness clue, not proof that the queue is shrinking or that a location was found.
-The default country profile is `US` (contiguous United States); use `--country DE` for Germany or `--country ES` for Spain. Spain uses a broad geographic envelope, so add independently justified `--bounds WEST SOUTH EAST NORTH` for a regional search. See [country profiles](docs/COUNTRIES.md) and the [local upload workflow](docs/PRODUCT.md) for request options, cancellation, resuming jobs, and upload limits.
+The default country profile is `US` (contiguous United States); use `--country DE` for Germany, `--country ES` for Spain, or `--country FR` for metropolitan France including Corsica. Spain and France use broad geographic envelopes without country polygons, so add independently justified `--bounds WEST SOUTH EAST NORTH` for a regional search. The France profile excludes overseas territories. See [country profiles](docs/COUNTRIES.md) and the [local upload workflow](docs/PRODUCT.md) for request options, cancellation, resuming jobs, and upload limits.
**Data requirements:** Initial online acquisition may take hours and tens of gigabytes of disk space, depending on the recording time and search region. Downloads and caches are reusable; the application does not enforce an automatic disk-space cap.
diff --git a/docs/COUNTRIES.md b/docs/COUNTRIES.md
index d721d35..712deb4 100644
--- a/docs/COUNTRIES.md
+++ b/docs/COUNTRIES.md
@@ -1,21 +1,24 @@
# Country profiles
-The automatic request and upload interface support three receiver regions:
+The automatic request and upload interface support four receiver regions:
| Country | Coverage | Envelope: west, south, east, north | Search CRS | Receiver region |
| --- | --- | --- | --- | --- |
| `US` | `conus` | `-125, 24, -66, 50` | `EPSG:5070` | Existing CONUS rectangle |
| `DE` | `germany` | `5.5, 47, 15.5, 55.2` | `EPSG:32632` | BKG VG250 Germany land polygon inside the envelope |
| `ES` | `spain` | `-18.2, 27.5, 4.5, 43.9` | `EPSG:6933` | Spain and territories bounding envelope; no country polygon |
+| `FR` | `france` | `-5.5, 41.2, 10, 51.2` | `EPSG:2154` | Metropolitan France including Corsica bounding envelope; no country polygon |
The envelope limits optional rectangular subsets. Germany's envelope includes
foreign territory; the land polygon removes those receiver locations before
terrain sampling or scoring. Islands, exclaves and polygon holes are preserved.
The boundary is generalized geographic data, not a survey of a microphone site.
Spain uses an outer envelope covering mainland Spain and its island territories.
-It does not apply a Spanish land mask, so a search must provide explicit bounds
-that describe the intended receiver area. Aircraft outside the receiver bounds
-remain eligible when they are within the acoustic search margin. Country support
+France covers mainland France and Corsica, excluding overseas departments and
+territories, with a Lambert-93 metric search grid. These two profiles do not
+apply country land masks: their envelopes include sea and neighboring countries.
+Use explicit bounds that describe the intended receiver area. Aircraft outside
+the receiver bounds remain eligible when they are within the acoustic search margin. Country support
does not establish localization accuracy.
## Requests and commands
@@ -26,9 +29,11 @@ dopplergeist analyze recording.mp3 --country DE --jobs jobs --online \
--time-source 'Evidence establishing the recording-start interval'
```
-The upload API accepts `"search":{"country":"DE"}` or
-`"search":{"country":"ES"}`. It also accepts the matching coverage names
-`germany` and `spain`. A normalized request records the coverage;
+Use `--country FR` for metropolitan France, including Corsica, or select France
+in the browser's country selector. The upload API accepts
+`"search":{"country":"DE"}`, `"search":{"country":"ES"}` or
+`"search":{"country":"FR"}`. It also accepts the matching coverage names
+`germany`, `spain` and `france`. A normalized request records the coverage;
an explicitly supplied country is normalized to uppercase. If both are supplied,
they must agree. `bounds_wsen` and `--bounds` narrow the selected profile. They
must be an independently justified prior, not the evaluation location.
@@ -102,7 +107,8 @@ python scripts/check_country_profiles.py --cache-root /tmp/dopplergeist-geograph
```
The check uses the actual pinned BKG geometry, named geographic points, country
-boundary grids, empty-area checks and worker serialization. It generates no audio or flight tracks.
+boundary grids, mainland France and Corsica grids, empty-area checks and worker
+serialization. It generates no audio or flight tracks.
These are software/geography checks, not an acoustic localization benchmark.
## Boundary license and source
diff --git a/docs/INTERFACES.md b/docs/INTERFACES.md
index 7ed92ca..74e6631 100644
--- a/docs/INTERFACES.md
+++ b/docs/INTERFACES.md
@@ -33,16 +33,18 @@ returns `needs_input` with `required_fields: ["time_window"]` if a defensible wi
is still unavailable. Do not fabricate a timestamp. A derived best recording start
is a result field and must not be mislabeled independent timestamp evidence.
-`search.country` accepts `US` (CONUS), `DE` (Germany) or `ES` (Spain); lowercase
-ISO codes are normalized. The corresponding `search.coverage` values are
-`conus`, `germany` and `spain`.
+`search.country` accepts `US` (CONUS), `DE` (Germany), `ES` (Spain) or `FR`
+(metropolitan France including Corsica); lowercase ISO codes are normalized.
+The corresponding `search.coverage` values are
+`conus`, `germany`, `spain` and `france`.
Either country or coverage is sufficient, and contradictory values are rejected.
Legacy `{"coverage":"conus"}` objects keep their serialized shape; the validator
does not insert a country into old requests. Optional `bounds_wsen` further restrict
the selected profile to `[west, south, east, north]` in longitude/latitude degrees.
Bounds must lie inside its declared envelope. Germany's land mask further limits
-receiver points. Spain uses a bounding envelope without a country polygon and
-requires explicit bounds for a suitably regional search. Neighboring aircraft
+receiver points. Spain and metropolitan France use bounding envelopes without
+country polygons; provide explicit bounds for a suitably regional search. The
+France profile excludes overseas territories. Neighboring aircraft
remain eligible outside the receiver area when they fall within acoustic range. The capability
response publishes the supported catalog; see [country profiles](COUNTRIES.md).
Actual data availability may be smaller and must be reported in provenance and
diff --git a/docs/PRODUCT.md b/docs/PRODUCT.md
index 7bd8d72..d0491a6 100644
--- a/docs/PRODUCT.md
+++ b/docs/PRODUCT.md
@@ -9,7 +9,8 @@ scope and limitations.
The automatic product path is separate from the historical research `run` and
`measure` commands. Uploads supply audio, an optional defensible UTC window for
-**sample zero**, and a declared country profile (US/CONUS by default, or Germany).
+**sample zero**, and a declared country profile (US/CONUS by default, Germany,
+Spain or metropolitan France including Corsica).
An optional rectangle narrows that profile. Event windows, frequency
bands, flight IDs and ground-truth coordinates are not upload inputs.
@@ -86,6 +87,12 @@ The API equivalent is `"search":{"country":"DE"}`; normalized requests record
search, parallel workers, fine grids and continuous refinement. See
[country profiles](COUNTRIES.md) for boundary acquisition, offline use and limits.
+For metropolitan France including Corsica, use `analyze --country FR`, the France
+browser option, or `"search":{"country":"FR"}` in the API. Requests normalize to
+`"coverage":"france"` and use `EPSG:2154` (Lambert-93). The profile is a bounding
+envelope without a country polygon; use independently justified `--bounds` for
+a regional search. Overseas territories are outside this profile.
+
`analyze` prints the job ID and a monitor command to standard error as soon as
the upload is queued. `job --watch` reports the status-file progress field, the
count/rate of matching coarse and fine search filenames, the newest matching
diff --git a/scripts/check_country_profiles.py b/scripts/check_country_profiles.py
index e81dbd0..8f85f71 100644
--- a/scripts/check_country_profiles.py
+++ b/scripts/check_country_profiles.py
@@ -37,6 +37,8 @@ def check_contracts():
conus_subset = [-90.0, 40.0, -87.0, 43.0]
buesingen_subset = [8.66, 47.68, 8.72, 47.72]
madrid_subset = [-4.16, 40.05, -2.97, 40.95]
+ paris_subset = [2.2, 48.8, 2.5, 48.95]
+ corsica_subset = [9.0, 41.3, 9.3, 41.5]
cases = (
("omitted search", None, {"coverage": "conus"}, "US"),
("legacy CONUS", {"coverage": "conus"}, {"coverage": "conus"}, "US"),
@@ -53,6 +55,14 @@ def check_contracts():
("Spain coverage", {"coverage": "spain"}, {"coverage": "spain"}, "ES"),
("Spain region", {"country": "ES", "bounds_wsen": madrid_subset},
{"country": "ES", "coverage": "spain", "bounds_wsen": madrid_subset}, "ES"),
+ ("France country", {"country": "fr"}, {"country": "FR", "coverage": "france"}, "FR"),
+ ("France coverage", {"coverage": "france"}, {"coverage": "france"}, "FR"),
+ ("explicit France", {"country": "FR", "coverage": "france"},
+ {"country": "FR", "coverage": "france"}, "FR"),
+ ("France region", {"country": "FR", "bounds_wsen": paris_subset},
+ {"country": "FR", "coverage": "france", "bounds_wsen": paris_subset}, "FR"),
+ ("Corsica region", {"coverage": "france", "bounds_wsen": corsica_subset},
+ {"coverage": "france", "bounds_wsen": corsica_subset}, "FR"),
)
validated = {}
for name, search, expected, country in cases:
@@ -74,7 +84,14 @@ def check_contracts():
{"country": "DE", "coverage": "conus"},
{"country": "US", "coverage": "germany"},
{"country": "DE", "coverage": "spain"},
- {"country": "FR"},
+ {"country": "IT"},
+ {"country": "FR", "coverage": "conus"},
+ {"country": "FR", "coverage": "spain"},
+ {"country": "DE", "coverage": "france"},
+ {"country": "FR", "bounds_wsen": conus_subset},
+ # French Guiana and Reunion are outside the metropolitan profile.
+ {"country": "FR", "bounds_wsen": [-52.5, 4.8, -52.2, 5.0]},
+ {"country": "FR", "bounds_wsen": [55.3, -21.3, 55.6, -21.0]},
{"coverage": "custom"},
{"country": None},
{"coverage": None},
@@ -94,8 +111,8 @@ def check_contracts():
raise CheckFailure(f"Invalid search was accepted: {search!r}")
catalog = public_profiles()
- require(len(catalog) == 3 and {p["country"] for p in catalog} == {"US", "DE", "ES"},
- "Capabilities must describe exactly the supported US, DE and ES profiles")
+ require(len(catalog) == 4 and {p["country"] for p in catalog} == {"US", "DE", "ES", "FR"},
+ "Capabilities must describe exactly the supported US, DE, ES and FR profiles")
for item in catalog:
profile = profile_for_search({"country": item["country"]})
require(item["coverage"] == profile.coverage and item["crs"] == profile.crs
@@ -106,6 +123,8 @@ def check_contracts():
"Germany must use its declared UTM 32N search CRS")
require(profile_for_search({"country": "ES"}).crs == "EPSG:6933",
"Spain must use its declared global equal-area search CRS")
+ require(profile_for_search({"country": "FR"}).crs == "EPSG:2154",
+ "Metropolitan France must use its declared Lambert-93 search CRS")
print(f"PASS requests: {len(cases)} normalization/JSON round-trip cases; "
f"{len(rejected)} invalid declarations rejected; profile catalog agrees")
return validated
@@ -211,6 +230,45 @@ def check_spain_grid(validated):
"no country polygon applied")
+def check_france_grids(cache_root, validated):
+ import numpy as np
+ from pyproj import CRS, Transformer
+ from dopplergeist.geography import profile_for_search, receiver_mask_for_search
+ from dopplergeist.tiled_search import _grid_extent, _tile_coordinates
+
+ profile = profile_for_search(validated["France country"]["search"])
+ # Rounded real landmarks check the envelope, not recording-location truth.
+ places = (("Brest", -4.49, 48.39), ("Dunkirk", 2.38, 51.04),
+ ("Paris", 2.35, 48.86), ("Bonifacio, Corsica", 9.16, 41.39))
+ west, south, east, north = profile.bounds_wsen
+ require(all(west < lon < east and south < lat < north for _, lon, lat in places),
+ "France envelope must include western/northern mainland France and southern Corsica")
+ area = CRS(profile.crs).area_of_use
+ require(area.west <= west < east <= area.east and area.south <= south < north <= area.north,
+ "France envelope must stay within the search CRS area of use")
+ forward = Transformer.from_crs("EPSG:4326", profile.crs, always_xy=True)
+ for name in ("France region", "Corsica region"):
+ search = validated[name]["search"]
+ require(receiver_mask_for_search(search, cache_root=cache_root, offline=True) is None,
+ f"{name}: the bounding envelope must not acquire a German polygon")
+ bounds = search["bounds_wsen"]
+ for spacing in (2000.0, 250.0):
+ xmin, ymin, xmax, ymax = _grid_extent(bounds, spacing, profile.crs)
+ receivers = _tile_coordinates((xmin, ymin, xmax + 1, ymax + 1), spacing,
+ bounds, profile.crs)
+ require(len(receivers) > 0, f"{name}: no {spacing:g} m receivers inside the selected bounds")
+ x, y = forward.transform(receivers.lon.to_numpy(), receivers.lat.to_numpy())
+ require(np.isfinite(x).all() and np.isfinite(y).all()
+ and np.allclose(x, receivers.x.to_numpy(), rtol=0, atol=1e-5)
+ and np.allclose(y, receivers.y.to_numpy(), rtol=0, atol=1e-5),
+ f"{name}: grid x/y disagree with Lambert-93")
+ w, s, e, n = bounds
+ require(bool(np.all((receivers.lon >= w) & (receivers.lon <= e)
+ & (receivers.lat >= s) & (receivers.lat <= n))),
+ f"{name}: receiver grid escaped the selected bounds")
+ print(f"PASS {name}: {len(receivers)} receivers at {spacing:g} m in Lambert-93; no country polygon")
+
+
def check_border_grid(mask, validated):
import numpy as np
from pyproj import Transformer
@@ -304,6 +362,7 @@ def main(argv=None):
args = parser.parse_args(argv)
try:
validated = check_contracts()
+ check_france_grids(args.cache_root, validated)
mask = check_mask(args.cache_root, args.online, validated)
check_spain_grid(validated)
check_border_grid(mask, validated)
diff --git a/src/dopplergeist/cli.py b/src/dopplergeist/cli.py
index 8a062f4..ebeae41 100644
--- a/src/dopplergeist/cli.py
+++ b/src/dopplergeist/cli.py
@@ -120,8 +120,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("--country",type=str.upper,choices=("US", "DE", "ES"),
- help="Receiver country: US (CONUS, default), DE (Germany), or ES (Spain)")
+ analyze.add_argument("--country",type=str.upper,choices=("US", "DE", "ES", "FR"),
+ help="Receiver country: US (CONUS, default), DE (Germany), ES (Spain), or FR (metropolitan France, including Corsica)")
analyze.add_argument("--bounds",type=float,nargs=4,metavar=("WEST", "SOUTH", "EAST", "NORTH"),
help="Limit the selected country profile to a WGS84 rectangle in decimal degrees")
analyze.add_argument("--jobs",default="jobs",help="Persistent job directory")
diff --git a/src/dopplergeist/contracts.py b/src/dopplergeist/contracts.py
index 749ed30..9f429b4 100644
--- a/src/dopplergeist/contracts.py
+++ b/src/dopplergeist/contracts.py
@@ -21,8 +21,8 @@ class RecordingTimeWindow(TypedDict):
class SearchArea(TypedDict):
- country: NotRequired[Literal["US", "DE", "ES"]]
- coverage: NotRequired[Literal["conus", "germany", "spain"]]
+ country: NotRequired[Literal["US", "DE", "ES", "FR"]]
+ coverage: NotRequired[Literal["conus", "germany", "spain", "france"]]
bounds_wsen: NotRequired[list[float]]
diff --git a/src/dopplergeist/geography.py b/src/dopplergeist/geography.py
index 57ed490..31a947e 100644
--- a/src/dopplergeist/geography.py
+++ b/src/dopplergeist/geography.py
@@ -2,9 +2,9 @@
Country masks restrict receiver locations, never aircraft trajectories. The US
profile deliberately retains the historical CONUS rectangle and CRS. Germany
-uses BKG VG250 land geometry in its native ETRS89 / UTM 32N coordinates. Spain
-uses an outer geographic envelope and global equal-area projection; the caller's
-declared bounds select the actual receiver search region.
+uses BKG VG250 land geometry in its native ETRS89 / UTM 32N coordinates. Spain
+and metropolitan France use outer geographic envelopes; the caller's declared
+bounds select the actual receiver search region.
"""
from copy import deepcopy
from dataclasses import dataclass
@@ -34,6 +34,8 @@ _PROFILES = {
(5.5, 47.0, 15.5, 55.2), "EPSG:32632"),
"ES": SearchProfile("ES", "spain", "Spain (all territories; bounding envelope)",
(-18.2, 27.5, 4.5, 43.9), "EPSG:6933"),
+ "FR": SearchProfile("FR", "france", "France (metropolitan; bounding envelope)",
+ (-5.5, 41.2, 10.0, 51.2), "EPSG:2154"),
}
_COVERAGE_COUNTRIES = {p.coverage: code for code, p in _PROFILES.items()}
@@ -70,10 +72,10 @@ def profile_for_search(search=None):
coverage = search.get("coverage")
if "country" in search:
if not isinstance(country, str) or country.upper() not in _PROFILES:
- raise ValueError("Supported countries are US (CONUS), DE (Germany) and ES (Spain)")
+ raise ValueError("Supported countries are US (CONUS), DE (Germany), ES (Spain) and FR (metropolitan France)")
country = country.upper()
if "coverage" in search and (not isinstance(coverage, str) or coverage not in _COVERAGE_COUNTRIES):
- raise ValueError("Supported coverage values are conus (US/CONUS), germany (DE) and spain (ES)")
+ raise ValueError("Supported coverage values are conus (US/CONUS), germany (DE), spain (ES) and france (FR)")
if country is None:
country = _COVERAGE_COUNTRIES.get(coverage, "US")
profile = _PROFILES[country]