Skip to content

Commit 4c263d3

Browse files
authored
Merge pull request #63 from AndreHauschild/devel
Fix problems decoding GLONASS and SBAS BRDC, adjust observation noise settings
2 parents 68e3004 + a84d18c commit 4c263d3

File tree

4 files changed

+46
-31
lines changed

4 files changed

+46
-31
lines changed

src/cssrlib/peph.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -686,7 +686,7 @@ def substSigTx(pcv, sig):
686686

687687
def substSigRx(pcv, sig):
688688
"""
689-
Substitute frequency band for PCO/PCV selection of receving antenna.
689+
Substitute frequency band for PCO/PCV selection of receiving antenna.
690690
691691
This function converts a RINEX observation code to a phase observation code
692692
without tracking attribute. If the signal is not available in the list of
@@ -709,7 +709,7 @@ def substSigRx(pcv, sig):
709709
#
710710
sig = sig.toTyp(uTYP.L).toAtt()
711711

712-
# Use directly if an corresponsing offset exists
712+
# Use directly if an corresponding offset exists
713713
#
714714
if sig in pcv.off:
715715
return sig
@@ -894,17 +894,17 @@ def antModelRx(nav, pos, e, sigs, rtype=1):
894894
else: # for base
895895
ant = nav.rcv_ant_b
896896

897-
# Elevation angle, zenit angle and zenit angle grid
897+
# Elevation angle, zenith angle and zenith angle grid
898898
#
899899
za = np.rad2deg(np.arccos(e[2]))
900900
za_t = np.arange(ant.zen[0], ant.zen[1]+ant.zen[2], ant.zen[2])
901901

902-
# Loop over singals
902+
# Loop over signals
903903
#
904904
dant = np.zeros(len(sigs))
905905
for i, sig_ in enumerate(sigs):
906906

907-
# Subsititute signal if not available
907+
# Substitute signal if not available
908908
#
909909
sig = substSigRx(ant, sig_)
910910

src/cssrlib/pntpos.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def ionmodel(t, pos, az, el, nav=None, model=uIonoModel.KLOBUCHAR, cs=None):
4646
if cs is None or cs.iodi < 0:
4747
diono = ionKlobuchar(t, pos, az, el, nav.ion)
4848
return diono
49-
diono, var = ionoSBAS(t, pos, az, el, cs)
49+
diono, _ = ionoSBAS(t, pos, az, el, cs)
5050
if diono == 0.0:
5151
diono = ionKlobuchar(t, pos, az, el, nav.ion)
5252

@@ -104,8 +104,8 @@ def __init__(self, nav, pos0=np.zeros(3), logfile=None, trop_opt=0,
104104

105105
# Observation noise parameters
106106
#
107-
self.nav.eratio = np.ones(self.nav.nf)*100 # [-] factor
108-
self.nav.err = [0, 0.000, 0.003] # [m] sigma
107+
self.nav.eratio = np.ones(self.nav.nf)*50 # [-] factor
108+
self.nav.err = [0, 0.01, 0.005] # [m] sigma
109109

110110
# Initial sigma for state covariance
111111
#
@@ -176,8 +176,6 @@ def __init__(self, nav, pos0=np.zeros(3), logfile=None, trop_opt=0,
176176
def csmooth(self, obs: Obs, sat, Pm, Lm, ns=100, dt_th=1, cs_th=10):
177177
""" Hatch filter for carrier smoothing """
178178

179-
sys, _ = sat2prn(sat)
180-
181179
if Pm == 0.0 or Lm == 0.0:
182180
self.cs_cnt[sat] = 1
183181
return Pm

src/cssrlib/pppssr.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ def __init__(self, nav, pos0=np.zeros(3),
8989
#
9090
# Observation noise parameters
9191
#
92-
self.nav.eratio = np.ones(self.nav.nf)*100 # [-] factor
93-
self.nav.err = [0, 0.000, 0.003] # [m] sigma
92+
self.nav.eratio = np.ones(self.nav.nf)*50 # [-] factor
93+
self.nav.err = [0, 0.01, 0.005]/np.sqrt(2) # [m] sigma
9494

9595
# Initial sigma for state covariance
9696
#

src/cssrlib/rinex.py

Lines changed: 36 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ def decode_nav(self, navfile, nav, append=False):
156156
if not append:
157157
nav.eph = []
158158
nav.geph = []
159+
nav.seph = []
159160

160161
with open(navfile, 'rt') as fnav:
161162
for line in fnav:
@@ -314,7 +315,7 @@ def decode_nav(self, navfile, nav, append=False):
314315
nav.ion_prm[sys][im].prm[0:3] = \
315316
[c_A, c_F10_7, c_Ap]
316317

317-
else: # Klobucher (LNAV, D1D2, CNVX)
318+
else: # Klobuchar (LNAV, D1D2, CNVX)
318319
nav.ion_prm[sys][im].prm = np.zeros(9)
319320

320321
for k in range(3):
@@ -365,6 +366,10 @@ def decode_nav(self, navfile, nav, append=False):
365366
sat = prn2sat(sys, prn)
366367
geph = Geph(sat)
367368

369+
pos = np.zeros(3)
370+
vel = np.zeros(3)
371+
acc = np.zeros(3)
372+
368373
geph.mode = self.mode_nav
369374
toc = self.decode_time(line, 4)
370375
week, tocs = time2gpst(toc)
@@ -380,15 +385,15 @@ def decode_nav(self, navfile, nav, append=False):
380385
bet_ = self.flt(line, 3) # clock drift rate
381386

382387
line = fnav.readline() # line #1
383-
geph.pos[0] = self.flt(line, 0)*1e3
384-
geph.vel[0] = self.flt(line, 1)*1e3
385-
geph.acc[0] = self.flt(line, 2)*1e3
388+
pos[0] = self.flt(line, 0)*1e3
389+
vel[0] = self.flt(line, 1)*1e3
390+
acc[0] = self.flt(line, 2)*1e3
386391
geph.svh = int(self.flt(line, 3))
387392

388393
line = fnav.readline() # line #2
389-
geph.pos[1] = self.flt(line, 0)*1e3
390-
geph.vel[1] = self.flt(line, 1)*1e3
391-
geph.acc[1] = self.flt(line, 2)*1e3
394+
pos[1] = self.flt(line, 0)*1e3
395+
vel[1] = self.flt(line, 1)*1e3
396+
acc[1] = self.flt(line, 2)*1e3
392397

393398
if self.mode_nav == 0: # FDMA
394399
geph.frq = int(self.flt(line, 3))
@@ -399,9 +404,13 @@ def decode_nav(self, navfile, nav, append=False):
399404
dvalid = int(self.flt(line, 3))
400405

401406
line = fnav.readline() # line #3
402-
geph.pos[2] = self.flt(line, 0)*1e3
403-
geph.vel[2] = self.flt(line, 1)*1e3
404-
geph.acc[2] = self.flt(line, 2)*1e3
407+
pos[2] = self.flt(line, 0)*1e3
408+
vel[2] = self.flt(line, 1)*1e3
409+
acc[2] = self.flt(line, 2)*1e3
410+
411+
geph.pos = pos
412+
geph.vel = vel
413+
geph.acc = acc
405414

406415
if self.mode_nav == 0: # FDMA
407416
geph.age = int(self.flt(line, 3))
@@ -470,29 +479,37 @@ def decode_nav(self, navfile, nav, append=False):
470479
sat = prn2sat(sys, prn)
471480
seph = Seph(sat)
472481

482+
pos = np.zeros(3)
483+
vel = np.zeros(3)
484+
acc = np.zeros(3)
485+
473486
seph.toc = self.decode_time(line, 4)
474487
seph.af0 = self.flt(line, 1)
475488
seph.af1 = self.flt(line, 2)
476489
seph.tot = self.flt(line, 3)
477490

478491
line = fnav.readline() # line #1
479-
seph.pos[0] = self.flt(line, 0)*1e3
480-
seph.vel[0] = self.flt(line, 1)*1e3
481-
seph.pos[0] = self.flt(line, 2)*1e3
492+
pos[0] = self.flt(line, 0)*1e3
493+
vel[0] = self.flt(line, 1)*1e3
494+
acc[0] = self.flt(line, 2)*1e3
482495
seph.svh = int(self.flt(line, 3))
483496

484497
line = fnav.readline() # line #2
485-
seph.pos[1] = self.flt(line, 0)*1e3
486-
seph.vel[1] = self.flt(line, 1)*1e3
487-
seph.pos[1] = self.flt(line, 2)*1e3
498+
pos[1] = self.flt(line, 0)*1e3
499+
vel[1] = self.flt(line, 1)*1e3
500+
acc[1] = self.flt(line, 2)*1e3
488501
seph.sva = self.flt(line, 3)
489502

490503
line = fnav.readline() # line #3
491-
seph.pos[2] = self.flt(line, 0)*1e3
492-
seph.vel[2] = self.flt(line, 1)*1e3
493-
seph.pos[2] = self.flt(line, 2)*1e3
504+
pos[2] = self.flt(line, 0)*1e3
505+
vel[2] = self.flt(line, 1)*1e3
506+
acc[2] = self.flt(line, 2)*1e3
494507
seph.iodn = int(self.flt(line, 3))
495508

509+
seph.pos = pos
510+
seph.vel = vel
511+
seph.acc = acc
512+
496513
nav.seph.append(seph)
497514
continue
498515

0 commit comments

Comments
 (0)