Skip to content

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

Merge remote-tracking branch 'origin/main' into swarm/w1-acoustic-sieve

Cinna Davis104af828021e
diff --cc src/dopplergeist/tiled_search.py
index 1ba59e5,cda2b60..866495b
--- a/src/dopplergeist/tiled_search.py
+++ b/src/dopplergeist/tiled_search.py
@@@ -188,8 -154,24 +188,24 @@@ def _tracks(indexes, bounds, time_range
return tracks
+ def _association_clock_window(start_window, sweep_s):
+ """Enclose every association clock that could reach the scoring window."""
+ lower, upper = map(float, start_window)
+ if not all(math.isfinite(v) for v in (lower, upper, sweep_s)) or lower > upper or sweep_s < 0:
+ raise ValueError("Recording clock bounds and sweep must be finite and ordered")
+ # Association intervals are expanded by the scorer before intersection with
+ # the requested window. Prune only outside that expanded envelope. Round
+ # both the envelope and its center/radius representation outward at Unix
+ # timestamp precision, so an inclusive endpoint cannot disappear.
+ lower = math.nextafter(lower - sweep_s, -math.inf)
+ upper = math.nextafter(upper + sweep_s, math.inf)
+ center = lower + (upper - lower) / 2
+ tolerance = math.nextafter(max(center - lower, upper - center), math.inf)
+ return center, tolerance
+
+
@_cache_ridge_fits
-def _score(points, tracks, events, measurements, budget, parameters, filters, start_window=None, *, ledger=None, stage=None):
+def _score(points, tracks, events, measurements, budget, parameters, filters, start_window=None, *, ledger=None, stage=None, score_floor=None):
radius = max(e["slant_range_m"][1] for e in events)
observers = ecef(points.lat.to_numpy(), points.lon.to_numpy(), points.elev_m.to_numpy())
tables, count = [], 0