Skip to content

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

Keep original bounds for unusual silence margins

Cinna Davis161128f99c3e
diff --git a/src/dopplergeist/automatic.py b/src/dopplergeist/automatic.py
index 6529a7f..7e533e1 100644
--- a/src/dopplergeist/automatic.py
+++ b/src/dopplergeist/automatic.py
@@ -106,6 +106,13 @@ def _earliest_emission(lo, events, max_distance, c, filters):
offset = float(filters.get("offset_tolerance_s", 5.0))
if not math.isfinite(offset) or offset < 0 or not math.isfinite(c) or c <= 0:
return original
+ silence = filters.get("silence")
+ if silence:
+ if not isinstance(silence, dict):
+ return original
+ margin = float(silence.get("edge_margin_s", 60))
+ if not math.isfinite(margin) or margin < 0:
+ return original
# Candidate association allows half the offset tolerance beyond each
# event's CPA interval, then the wide-clock scorer allows a 5 s sweep.
earliest_cpa = min(e["cpa_receive_s"] - e["quality"]["cpa_tolerance_s"] for e in events)