Skip to content

Commit

Permalink
added RINEX navigation message for SBAS.
Browse files Browse the repository at this point in the history
  • Loading branch information
hirokawa committed Jan 8, 2025
1 parent 325b809 commit 0ac09be
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 5 deletions.
9 changes: 8 additions & 1 deletion receiver/decode_jps.py
Original file line number Diff line number Diff line change
Expand Up @@ -698,12 +698,19 @@ def decode(self, buff, len_, sys=[], prn=[]):
print("[WD] prn={:d} tow={:d} type={:d}".
format(prn, time_, type_))

sat = prn2sat(uGNSS.SBS, prn)
b = buff[12:]
if self.flg_sbas and self.flg_rnxnav:
seph = self.rn.decode_sbs_l1(self.week, time_, sat, b)
if seph is not None:
self.re.rnx_snav_body(seph, self.fh_rnxnav)

if self.flg_sbas and self.week >= 0:
if sbs_ref > 0 and prn != sbs_ref:
return
self.fh_sbas.write("{:4d}\t{:6d}\t{:3d}\t{:1d}\t{:3d}\t{:s}\n".
format(self.week, time_, prn, type_, len_,
hexlify(buff[12:]).decode()))
hexlify(b).decode()))

elif head[0] == 'r' and head[1] in self.ch_t.keys():
# Integer Pseudo-ranges
Expand Down
10 changes: 10 additions & 0 deletions receiver/decode_sbf.py
Original file line number Diff line number Diff line change
Expand Up @@ -558,12 +558,21 @@ def decode(self, buff, len_, sys=[], prn=[]):
self.fh_sbas.write("{:4d}\t{:6d}\t{:3d}\t{:2d}\t{:3d}\t".
format(self.week, int(self.tow), prn,
src-24, 32))
msg = bytearray(32)
for i in range(8):
d = st.unpack_from('<L', buff, k)[0]
self.fh_sbas.write("{:08x}".format(d))
st.pack_into('>L', msg, i*4, d)
k += 4
self.fh_sbas.write("\n")

sat = prn2sat(uGNSS.SBS, prn)
seph = None
if blk_num == 4020:
seph = self.rn.decode_sbs_l1(self.week, self.tow, sat, msg)
if seph is not None:
self.re.rnx_snav_body(seph, self.fh_rnxnav)

elif blk_num == 4022: # GalRawFNAV
sys, prn = self.decode_head(buff, k)
sat = prn2sat(sys, prn)
Expand Down Expand Up @@ -683,6 +692,7 @@ def decode(self, buff, len_, sys=[], prn=[]):
k += 7
crcpass, cnt, src, freq, ch = st.unpack_from('<BBBBB', buff, k)
k += 5
freq -= 8
if self.flg_gloca:
if crcpass != 1:
if self.monlevel > 0:
Expand Down
25 changes: 21 additions & 4 deletions receiver/decode_ubx.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ def decode_nav(self, buff, k=6):
fh_ = None
eph = None
geph = None
seph = None
type_ = sigid
blen = len_*4
if sys == uGNSS.GPS:
Expand Down Expand Up @@ -287,8 +288,18 @@ def decode_nav(self, buff, k=6):
fh_ = self.fh_galcnav
type_ = 6
elif sys == uGNSS.BDS:
if sigid == 4 and self.flg_bdsd12: # B3I D1
if sigid == 0 and self.flg_bdsd12: # B1I D1
type_ = 0
# eph = self.rn.decode_bds_d1(self.week, self.tow, sat, b)
elif sigid == 1 and self.flg_bdsd12: # B1I D2
type_ = 0
elif sigid == 2 and self.flg_bdsd12: # B2I D1
type_ = 1
elif sigid == 3 and self.flg_bdsd12: # B2I D2
type_ = 1
elif sigid == 4 and self.flg_bdsd12: # B3I D1
type_ = 2
# eph = self.rn.decode_bds_d1(self.week, self.tow, sat, b, 2)
elif sigid == 6 and self.flg_bdsb1c: # B1Cd
fh_ = self.fh_bdsb1c
type_ = 3
Expand All @@ -312,7 +323,10 @@ def decode_nav(self, buff, k=6):
self.week, self.tow, sat, b)
elif sigid == 8 and self.flg_bdsb2a: # B2ad
type_ = 5
elif sigid == 10 and self.flg_bdsd12: # B3I D2
type_ = 2
elif sys == uGNSS.GLO:
freqid -= 7
if sigid == 0 and self.flg_gloca: # L1 OF
type_ = 0
geph = self.rn.decode_glo_fdma(self.week, self.tow,
Expand All @@ -325,6 +339,7 @@ def decode_nav(self, buff, k=6):
if sigid == 0 and self.flg_sbas: # L1C/A
fh_ = self.fh_sbas
type_ = 0
seph = self.rn.decode_sbs_l1(self.week, self.tow, sat, b)
elif sys == uGNSS.QZS:
if sigid == 0 and self.flg_qzslnav: # L1C/A
fh_ = self.fh_qzslnav
Expand All @@ -344,6 +359,8 @@ def decode_nav(self, buff, k=6):
self.re.rnx_nav_body(eph, self.fh_rnxnav)
if geph is not None:
self.re.rnx_gnav_body(geph, self.fh_rnxnav)
if seph is not None:
self.re.rnx_snav_body(seph, self.fh_rnxnav)

if fh_ is not None and blen > 0:
fh_.write("{:4d}\t{:6d}\t{:3d}\t{:1d}\t{:3d}\t{:s}\n".
Expand Down Expand Up @@ -417,10 +434,10 @@ def decode(self, buff, len_, sys=[], prn=[]):
opt.flg_bdsb1c = True
opt.flg_bdsb2a = False
opt.flg_bdsb2b = False
opt.flg_bdsd12 = False
opt.flg_gloca = False
opt.flg_bdsd12 = True
opt.flg_gloca = True
opt.flg_irnnav = False
opt.flg_sbas = False
opt.flg_sbas = True
opt.flg_rnxnav = True
opt.flg_rnxobs = True

Expand Down

0 comments on commit 0ac09be

Please sign in to comment.