Skip to content

Commit

Permalink
Enable batch processing
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreHauschild committed Apr 8, 2024
1 parent 00f9b4c commit 85b3e68
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions receiver/decode_jps.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import bitstruct.c as bs
from cssrlib.gnss import epoch2time, time2gpst, prn2sat, uGNSS, uTYP, rSigRnx
from cssrlib.rawnav import rcvDec, rcvOpt
from glob import glob
from enum import IntEnum
from binascii import hexlify

Expand Down Expand Up @@ -717,10 +718,6 @@ def decode(self, buff, len_, sys=[], prn=[]):
bdir = '../data/doy223/'
fname = 'jav3223v.jps'

rtype = []

blen = os.path.getsize(bdir+fname)

opt = rcvOpt()
opt.flg_qzsl6 = True
opt.flg_gale6 = True
Expand All @@ -730,25 +727,31 @@ def decode(self, buff, len_, sys=[], prn=[]):
opt.flg_sbas = True
opt.flg_rnxnav = True

jps = jps(opt=opt, prefix=bdir+fname[4:].removesuffix('.jps')+'_')
# jps.dec.mon_level = 2
jps.monlevel = 2

prn_ref = 199
sbs_ref = -1

if True:
for f in glob(bdir+fnames):

print("Decoding {}".format(f))
bdir, fname = os.path.split(f)
bdir += '/'

prefix = bdir+fname[4:].removesuffix('.jps')+'_'
jpsdec = jps(opt=opt, prefix=bdir+fname[4:].removesuffix('.jps')+'_')
jpsdec.monlevel = 2

blen = os.path.getsize(bdir+fname)
with open(bdir+fname, 'rb') as f:
msg = f.read(blen)
maxlen = len(msg)-5
# maxlen = 400000
for k in range(maxlen):
stat = jps.sync(msg, k)
stat = jpsdec.sync(msg, k)
if not stat:
continue
k += 1
len_ = int(msg[k+2:k+5], 16)+5
jps.decode(msg[k:k+len_], len_)
jpsdec.decode(msg[k:k+len_], len_)
k += len_

jps.file_close()
jpsdec.file_close()

0 comments on commit 85b3e68

Please sign in to comment.