Read the pictures, the aircraft, the meters and the sensors
Hexadecimal is a true answer to "what did that say" and not a useful one. This is the work of turning the rest of what a receiver hears into something a person can read, and most of it is pictures. PICTURES Three of the things on the air are images rather than sounds, and all three arrive as the audio a scan already records: SSTV 14.230 and 144.5 MHz Martin M1/M2, Scottie S1/S2/DX, Robot 36/72 APT 137-138 MHz the NOAA weather satellites HF fax 2-20 MHz, sideband the marine weather charts Each is written from its published specification, and the generators used to test them are written from the same specification without reference to the decoders -- so a picture that comes back matching the one that went in is evidence about the format. Every SSTV mode reproduces its published line time exactly, which is worth failing a test over: a line a few milliseconds long walks the picture off the screen inside ten lines. Against synthetic transmissions at 30 dB SNR, SSTV is 96-98% of pixels exact, APT correlates at 0.97 and fax at 0.998; all three still read at 6-12 dB. None of the three is guessed at, and that is what makes it safe to try them on every recording. SSTV needs its VIS header, APT needs both line syncs at the right distance from each other, fax needs the phasing signal. No false pictures in 295 attempts over noise, tones, speech and swept whistles. Two things had to be got right beyond the arithmetic. A band-pass does not switch between two tones, it slides between them, so every edge is measured at the midpoint of the slide rather than at the first sample past a threshold -- the earlier version was reading the coarse search stride back as the edge and shifting Martin M1 sideways by a whole colour bar. And a picture now keeps its capture whatever the content check made of it: a satellite is a steady tone with a wobble on it and SSTV is a whistle, so both were being discarded as "no signal content" having already been recognised. PNG is written here rather than pulled in from Pillow. A scanner that cannot start because an imaging library is missing is worse than one that cannot draw. saunterbrowse marks a picture in the list, gives its path in full -- wrapped rather than cut off, because half a path opens nothing -- and moves or deletes the PNGs with the recording. o prints the picture's path, not the audio's. GRIB is not a modulation and is not pretended to be one. It is the format weather models are published in and it travels by satellite link and by e-mail; where a decoded byte stream begins with its magic number it is named, and that is all. AIRCRAFT `bandsaunter adsb` parks the receiver on 1090 MHz and reads Mode S extended squitter: address, callsign, altitude, position, speed. A command of its own because a megabit a second will not go through a channel twelve and a half kilohertz wide. Every frame carries a 24-bit checksum so there is no threshold anywhere in it -- with one trap, which is that a frame of all zeros satisfies that checksum and silence is exactly that. Positions round trip exactly through compact position reporting, and a pair straddling a longitude-zone boundary is refused rather than resolved against two grids. METERS AND SENSORS Itron ERT utility meters on 900 MHz and AcuRite weather sensors on 433 MHz are named rather than reported as hex, and neither is believed without its own checksum -- BCH(255,239) for the meter, a checksum and four parity bits for the sensor. Both are implemented from published descriptions and checked against frames built from the same descriptions, which proves the framing and the arithmetic and is not the same as having held a meter. HEX INTO WORDS Everything else that decodes to bits now gets its fields named where the shape is standard, its text read out where there is text, and its bytes laid out in groups with the printable characters beside them. The text search is where the care went, because printability is not evidence. Forty framings of each packet, and seven-bit values printable three in four, meant a bar set on printability called 64% of random payloads text. Real text is nearly all one case where random letters are half and half, two fifths vowels where random is a fifth, and mostly alphanumeric where random draws punctuation one time in four. Together: under 0.5%, measured in the suite. CALLSIGNS The licensed address is recorded in full -- the street, not merely the town -- and goes into the KML with everything else. US amateur records are public by law and carry it; holding it and not saying so is worse than either showing it or not asking, and --no-lookup asks for none of it. Also here: Morse is decoded again from the whole recording where the capture was made in cw mode. The first pass works from the classifier's buffer, which holds a few seconds -- enough to say "this is Morse", not enough to catch a callsign whole between two word gaps, so a beacon repeating every eight seconds through an eight-second window was never identified. And classify._psk_order took the logarithm of zero on a silent block. 1318 tests, up from 1161. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016PsWPTweCT6pwxKngvVxcg
This commit is contained in:
parent
b4718aa425
commit
3d7f76118e
32 changed files with 4426 additions and 39 deletions
|
|
@ -515,3 +515,59 @@ def test_an_unlisted_callsign_is_cached_too(tmp_path, monkeypatch):
|
|||
CallsignBook._apply(entry, {"status": "INVALID"})
|
||||
assert entry.status == "unlisted"
|
||||
assert entry.version == CACHE_VERSION
|
||||
|
||||
|
||||
# -- the whole address -------------------------------------------------------
|
||||
#
|
||||
# US amateur licence records are public by law and carry the street the
|
||||
# licence was issued to. It is recorded because holding it and not saying so
|
||||
# would be worse than either showing it or not asking for it, and --no-lookup
|
||||
# asks for none of it.
|
||||
|
||||
def test_the_street_is_read_off_the_licence(tmp_path):
|
||||
b = book(tmp_path, {"W1AW": {
|
||||
"status": "VALID", "current": {"callsign": "W1AW"},
|
||||
"name": "ARRL HQ OPERATORS CLUB",
|
||||
"address": {"line1": "225 MAIN ST", "line2": "NEWINGTON, CT 06111"},
|
||||
"location": {"latitude": "41.714", "longitude": "-72.727"}}})
|
||||
entry = b.get("W1AW")
|
||||
b.wait(5.0)
|
||||
assert entry.street == "225 Main St"
|
||||
assert entry.location == "Newington, CT"
|
||||
assert entry.postcode == "06111"
|
||||
assert entry.address == "225 Main St, Newington, CT, 06111"
|
||||
|
||||
|
||||
def test_the_street_is_shown_under_the_callsign(tmp_path):
|
||||
b = book(tmp_path, {"W1AW": {
|
||||
"status": "VALID", "current": {"callsign": "W1AW", "operClass": "CLUB"},
|
||||
"name": "ARRL", "address": {"line1": "225 MAIN ST",
|
||||
"line2": "NEWINGTON, CT 06111"},
|
||||
"location": {"gridsquare": "FN31pr"}}})
|
||||
entry = b.get("W1AW")
|
||||
b.wait(5.0)
|
||||
assert "225 Main St" in entry.details()
|
||||
|
||||
|
||||
def test_an_address_with_nothing_in_it_is_an_empty_string(tmp_path):
|
||||
b = book(tmp_path, {"W1AW": {"status": "INVALID"}})
|
||||
entry = b.get("W1AW")
|
||||
b.wait(5.0)
|
||||
assert entry.address == ""
|
||||
|
||||
|
||||
def test_a_record_cached_before_the_street_is_asked_about_again(tmp_path):
|
||||
"""The cache is versioned so an old entry is not kept with a field empty."""
|
||||
import json
|
||||
import time as _time
|
||||
cache = tmp_path / "calls.json"
|
||||
cache.write_text(json.dumps({"W1AW": {
|
||||
"call": "W1AW", "name": "ARRL", "status": "found",
|
||||
"fetched_at": _time.time(), "version": 2}}))
|
||||
b = StubBook({"W1AW": {
|
||||
"status": "VALID", "current": {"callsign": "W1AW"}, "name": "ARRL",
|
||||
"address": {"line1": "225 MAIN ST", "line2": "NEWINGTON, CT 06111"},
|
||||
"location": {}}}, cache=cache)
|
||||
entry = b.get("W1AW")
|
||||
b.wait(5.0)
|
||||
assert entry.street == "225 Main St"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue