Changeset 11215 in ntrip for trunk/BNC/tests/tools/bncraw.py


Ignore:
Timestamp:
Nov 19, 2026, 11:04:10 PM (less than one hour ago)
Author:
stuerze
Message:

Upload Ephemeris: majority vote included

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/tests/tools/bncraw.py

    r11130 r11215  
    1010    slice <raw> <out> [options]      cut a time window / subset of stations
    1111    crs   <raw>                      decode RTCM 1300/1301/1302 (CRS messages)
     12    ephsats <raw>                    satellite IDs of the ephemeris messages
    1213"""
    1314
    … …  
    246247
    247248
     249EPH_SYS = {"1019": ("G", 6), "1020": ("R", 6), "1041": ("I", 6), "1042": ("C", 6),
     250           "1044": ("J", 4), "1045": ("E", 6), "1046": ("E", 6)}
     251
     252
     253def cmd_ephsats(args):
     254    """Satellite IDs of the ephemeris messages per stream and message type."""
     255    sats = collections.OrderedDict()
     256    framers = {}
     257    for t, sta, fmt, data in read_chunks(args.input):
     258        for p in framers.setdefault(sta, Rtcm3Framer()).feed(data):
     259            mt = msg_type(p)
     260            if mt in EPH_SYS:
     261                sy, nb = EPH_SYS[mt]
     262                b = BitReader(p)
     263                b.u(12)
     264                sats.setdefault((sta, mt), set()).add("%s%02d" % (sy, b.u(nb)))
     265    for (sta, mt), s in sorted(sats.items()):
     266        print("%s %s %s" % (sta, mt, " ".join(sorted(s))))
     267
     268
    248269def main():
    249270    ap = argparse.ArgumentParser(description=__doc__,
    … …  
    269290    p.set_defaults(func=cmd_crs)
    270291
     292    p = sub.add_parser("ephsats", help="satellite IDs of the ephemeris messages")
     293    p.add_argument("input")
     294    p.set_defaults(func=cmd_ephsats)
     295
    271296    args = ap.parse_args()
    272297    args.func(args)
Note: See TracChangeset for help on using the changeset viewer.