From 296cdb3795c216c5c38932d315488214bf95d2d8 Mon Sep 17 00:00:00 2001 From: Ian Renton Date: Tue, 25 Nov 2025 21:32:48 +0000 Subject: [PATCH] Wider ranges to detect FT8/FT4 in "Guess mode based on frequency" function #85 --- core/lookup_helper.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/core/lookup_helper.py b/core/lookup_helper.py index 4b61101..0fc5f90 100644 --- a/core/lookup_helper.py +++ b/core/lookup_helper.py @@ -418,7 +418,20 @@ class LookupHelper: # Infer a mode from the frequency (in Hz) according to the band plan. Just a guess really. def infer_mode_from_frequency(self, freq): try: - return freq_to_band(freq / 1000.0)["mode"] + khz = freq / 1000.0 + mode = freq_to_band(khz)["mode"] + # Some additional common digimode ranges in addition to what the 3rd-party freq_to_band function returns. + # This is mostly here just because freq_to_band is very specific about things like FT8 frequencies, and e.g. + # a spot at 7074.5 kHz will be indicated as LSB, even though it's clearly in the FT8 range. Future updates + # might include other common digimode centres of activity here, but this achieves the main goal of keeping + # large numbers of clearly-FT* spots off the list of people filtering out digimodes. + if (7074 <= khz < 7077) or (10136 <= khz < 10139) or (14074 <= khz < 14077) or (18100 <= khz < 18103) or ( + 21074 <= khz < 21077) or (24915 <= khz < 24918) or (28074 <= khz < 28077): + mode = "FT8" + if (7047.5 <= khz < 7050.5) or (10140 <= khz < 10143) or (14080 <= khz < 14083) or ( + 18104 <= khz < 18107) or (21140 <= khz < 21143) or (24919 <= khz < 24922) or (28180 <= khz < 28183): + mode = "FT4" + return mode except KeyError: return None