source: ntrip/trunk/BNC/tests/tools/mk_qc_iod.py

Last change on this file was 11138, checked in by stuerze, 2 days ago

test suite updated

File size: 1.1 KB
Line 
1#!/usr/bin/env python3
2"""Regression capture for the SSR QC IOD check (tests/data/qc_iod_261015.raw).
3
4 ephemeris stream: each RTCM3 message of BCEP00BKG0 only at its first reception
5 (the stream repeats every data set every 5 s), START_EPH..END
6 SSR streams: complete, START_SSR..END
7
8usage: mk_qc_iod.py <SSR QC capture of 15 Oct 2026 (bncSsrQc.raw_261015)> <out>
9"""
10import sys
11sys.path.insert(0, '/home/andrea/tools/BNC/tests/tools')
12import bncraw
13
14EPH = 'BCEP00BKG0'
15SSR = ('SSRA00WHU1', 'SSRA00GMV1', 'SSRA00CNE1')
16START_EPH = '2026-10-15T00:00'
17START_SSR = '2026-10-15T01:55'
18END = '2026-10-15T02:10'
19
20
21def chunks(raw):
22 framer = bncraw.Rtcm3Framer()
23 seen = set()
24 for t, sta, fmt, data in bncraw.read_chunks(raw):
25 if t >= END:
26 return
27 if sta == EPH and t >= START_EPH:
28 new = [p for p in framer.feed(data) if p not in seen]
29 seen.update(new)
30 if new:
31 yield t, sta, fmt, b''.join(bncraw.frame(p) for p in new)
32 elif sta in SSR and t >= START_SSR:
33 yield t, sta, fmt, data
34
35
36bncraw.write_chunks(sys.argv[2], chunks(sys.argv[1]))
Note: See TracBrowser for help on using the repository browser.