MRTKLIB 0.7.14
Modernized GNSS Positioning Library
Loading...
Searching...
No Matches
mrtk_ppp_rtk.c File Reference

PPP-RTK positioning engine. More...

#include "mrtklib/mrtk_ppp_rtk.h"
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "mrtklib/mrtk_atmos.h"
#include "mrtklib/mrtk_clas.h"
#include "mrtklib/mrtk_const.h"
#include "mrtklib/mrtk_coords.h"
#include "mrtklib/mrtk_eph.h"
#include "mrtklib/mrtk_foundation.h"
#include "mrtklib/mrtk_lambda.h"
#include "mrtklib/mrtk_mat.h"
#include "mrtklib/mrtk_nav.h"
#include "mrtklib/mrtk_time.h"
#include "mrtklib/mrtk_trace.h"
Include dependency graph for mrtk_ppp_rtk.c:

Go to the source code of this file.

Macros

#define SQR(x)
#define SQRT(x)
#define MIN(x, y)
#define MAXREF   2 /* max iterations searching reference sat */
#define VAR_POS   SQR(30.0) /* initial variance of receiver pos (m^2) */
#define VAR_VEL   SQR(1.0) /* initial variance of receiver vel (m/s)^2 */
#define VAR_ACC   SQR(1.0) /* initial variance of receiver acc (m/ss)^2 */
#define VAR_GRA   SQR(0.001) /* gradient variance (m^2) */
#define INIT_ZWD   0.001 /* initial ZWD (m) */
#define BASELEN   1000.0 /* baseline length for iono update (m) */
#define MAXPBCORSSR   20.0 /* max phase bias correction of SSR (m) */
#define VARHOLDAMB   0.001 /* hold-ambiguity constraint variance */
#define ALPHAAR_DEFAULT   3 /* F-test significance index (5%) */
#define MINAMB_DEFAULT   2 /* minimum ambiguities for AR */
#define MAXOBSLOSS_DEFAULT   300.0 /* max obs gap to reset states (s) */
#define LAM_CARR_L1   (CLIGHT / FREQ1)
#define LAM_CARR_L2   (CLIGHT / FREQ2)
#define LAM_CARR_L5   (CLIGHT / FREQ5)
#define NF_RTK(opt)
#define NP_RTK(opt)
#define NI_RTK(opt)
#define NT_RTK(opt)
#define NR_RTK(opt)
#define NB_RTK(opt)
#define NX_RTK(opt)
#define II_RTK(s, opt)
#define IT_RTK(opt)
#define IB_RTK(s, f, opt)

Enumerations

enum  ddres_order { FST = 1 , SND , TRD }

Functions

static void load_ppp_osr_cpc (clas_osr_ctx_t *ctx, const double *cpc, const gtime_t *pt0)
static void save_ppp_osr_cpc (const clas_osr_ctx_t *ctx, double *cpc, gtime_t *pt0)
static uint8_t obs_code_for_freq (int sat, int f)
 Return default observation code for frequency index and system.
static double sat_lambda (int sat, int f, const nav_t *nav)
 Compute satellite-specific wavelength for frequency index.
static double varerr (int sat, int sys, double el, int type, const prcopt_t *opt)
 Compute measurement error variance.
static void initx (rtk_t *rtk, double xi, double var, int i)
 Initialize a state and its covariance.
static void udpos_ppp (rtk_t *rtk, const obsd_t *obs, int n, double tt)
 Temporal update of position states.
static void udtrop (rtk_t *rtk, double tt)
 Temporal update of tropospheric parameters.
static void udion (rtk_t *rtk, double tt, double bl, const obsd_t *obs, int ns)
 Temporal update of ionospheric parameters.
static void detslp_ll (rtk_t *rtk, const obsd_t *obs, int n)
 Detect cycle slip by LLI flag.
static double gfmeas_L1L2 (const obsd_t *obs, const nav_t *nav)
 L1/L2 geometry-free phase measurement.
static double gfmeas_L1L5 (const obsd_t *obs, const nav_t *nav)
 L1/L5 geometry-free phase measurement.
static void detslp_gf (rtk_t *rtk, const obsd_t *obs, int n, const nav_t *nav)
 Detect cycle slip by geometry-free phase jump.
static void udbias_ppp (rtk_t *rtk, double tt, const obsd_t *obs, int n, const nav_t *nav)
 Temporal update of phase biases.
static void udstate_ppp (rtk_t *rtk, const obsd_t *obs, int n, const nav_t *nav)
 Temporal update of all PPP-RTK states.
static double prectrop2 (gtime_t time, const double *pos, int r, const double *azel, const prcopt_t *opt, const double *x, double *dtdx)
 Compute precise tropospheric delay for KF.
static int validobs (int i, int f, int nf, double *y)
 Check if zero-difference observation is valid.
static void ddcov (const int *nb, int n, const double *Ri, const double *Rj, int nv, double *R)
 Build DD covariance from SD variances.
static int test_sys (int sys, int m, int qzsmodear, int code)
 Test if satellite system matches group index.
static int residual_test (rtk_t *rtk, const int *vflg, const double *v, const double *Q, int *iv, const int m, int *ns, const int flg)
 Validate residuals and reject outliers.
static int filter2_ (rtk_t *rtk, const double *x, const double *P, const double *H, const double *v, const double *R, const int n, const int m, double *xp, double *Pp, double *Qp, const int *vflg, const int flg)
 Inner KF measurement update with residual test.
static int filter2 (rtk_t *rtk, double *x, double *P, const double *H, const double *v, const double *R, const int n, const int m, const int *vflg, const int flg)
 KF measurement update with state compaction.
static int check_same_fac (const clas_ctx_t *clas)
 Test whether the two L6 channels currently carry the same facility.
static int valid_zd_sig (rtk_t *rtk, const obsd_t *obs, const nav_t *nav, double *y, int nf, int f, int i, int j, int m, int sati, int *satj, int *sysi, int *sysj, double *lami, double *lamj)
 Check that a satellite yields a usable zero-difference signal.
static void set_init_pb (rtk_t *rtk, const nav_t *nav, const obsd_t *obs, int n, int f, int satj)
 Re-initialize the phase-bias state of one satellite from phase-code.
static int ddres (rtk_t *rtk, const nav_t *nav, double *x, double **pbslip, const double *P, const obsd_t *obs, double **y, double *e, double *azel, int n, double *v, double *H, double *R, int *vflg, int niter, int pch, int order)
 Compute DD residuals and measurement matrix, merging L6 channels.
static int ddmat (rtk_t *rtk, double *D, int *indI, int *indJ)
 Build SD-to-DD transformation matrix D.
static void restamb (rtk_t *rtk, const double *bias, int nb, double *xa)
 Restore SD ambiguities from DD fixed values.
static void holdamb (rtk_t *rtk, const double *xa)
 Hold fixed ambiguities via pseudomeasurement constraint.
static void elsort (rtk_t *rtk, const obsd_t *obs, int *isat, double *el, int n)
 Sort satellites by elevation angle (ascending) for partial AR.
static double sddop (const rtk_t *rtk, const double *H, const int *vflg, double elmask, int nv)
static double zddop (const rtk_t *rtk, const double *azel, const obsd_t *obs, double elmask, int n)
static double calpdop (const rtk_t *rtk, const double *H, const double *azel, const int *vflg, const obsd_t *obs, double elmask, int n, int nv)
static int resamb_LAMBDA (rtk_t *rtk, double *bias, double *xa)
 Resolve integer ambiguity by LAMBDA.
int ppprtk_outstat (rtk_t *rtk, char *buff)
 Write PPP-RTK solution status to buffer.
int ppp_rtk_nx (const prcopt_t *opt)
 Compute number of estimated states for PPP-RTK.
int ppp_rtk_na (const prcopt_t *opt)
 Compute number of non-ambiguity states for PPP-RTK.
static void check_clas_facility (nav_t *nav, const clas_ctx_t *clas, const clas_grid_t *grid, const prcopt_t *opt)
void ppp_rtk_pos (rtk_t *rtk, const obsd_t *obs, int n, nav_t *nav)
 PPP-RTK positioning for one epoch (CLAS).
void rtkinit_ppp_rtk (rtk_t *rtk, const prcopt_t *opt)
 Initialize RTK control struct for PPP-RTK positioning.
void rtkfree_ppp_rtk (rtk_t *rtk)
 Free RTK control struct for PPP-RTK positioning.

Variables

static const double lam_carr [3] = { (CLIGHT / FREQ1) , (CLIGHT / FREQ2) , (CLIGHT / FREQ5) }
static const double chisqr [100]
static const double qf [6][60]
struct { 
   int   refsat [5 *2 *2 *6+1] 
   int   refsat2 [5 *2 *6+1] 
   double   cpc [SSR_CH_NUM][MAXSAT *5] 
   gtime_t   pt0 [SSR_CH_NUM][MAXSAT] 
   int   use_ch [5][MAXSAT+1] 
   int   pre_use_ch [5][MAXSAT+1] 
   clas_osr_ctx_t   osr_ctx 
   double   chisq 
   double *   Qp 
   int   Qp_nx 
   int   float_count 
   int   cntdiffp 
   int   floatcnt_reset 
   int   initialized 
} prtk_ctx

Detailed Description

PPP-RTK positioning engine.

References: [1] claslib ppprtk.c — upstream PPP-RTK implementation [2] claslib rtkcmn.c — upstream filter2/residual_test [6] MacMillan et al., Atmospheric gradients and the VLBI terrestrial and celestial reference frames, Geophys. Res. Let., 1997

Notes:

  • Ported from upstream claslib ppprtk.c as an independent positioning engine. Uses double-differencing (DD) with CLAS grid corrections, unlike the undifferenced PPP engine in mrtk_ppp.c.
  • Dual-channel (l6mrg) processing merges the two L6 transmit patterns: residuals are computed per channel and combined in ddres(), which picks a channel per satellite and, when the channels carry different facilities, resets the phase bias of a satellite that switches channel. With l6mrg off the engine runs on channel 0 only.

Definition in file mrtk_ppp_rtk.c.

Macro Definition Documentation

◆ ALPHAAR_DEFAULT

#define ALPHAAR_DEFAULT   3 /* F-test significance index (5%) */

Definition at line 77 of file mrtk_ppp_rtk.c.

Referenced by resamb_LAMBDA().

◆ BASELEN

#define BASELEN   1000.0 /* baseline length for iono update (m) */

Definition at line 71 of file mrtk_ppp_rtk.c.

Referenced by udstate_ppp().

◆ IB_RTK

#define IB_RTK ( s,
f,
opt )
Value:
(NR_RTK(opt) + MAXSAT * (f) + (s) - 1) /* bias state index */
#define NR_RTK(opt)
#define MAXSAT
Definition mrtk_coords.c:45

Definition at line 109 of file mrtk_ppp_rtk.c.

Referenced by ddres(), holdamb(), restamb(), set_init_pb(), and udbias_ppp().

◆ II_RTK

#define II_RTK ( s,
opt )
Value:
(NP_RTK(opt) + (s) - 1) /* iono state index */
#define NP_RTK(opt)

Definition at line 107 of file mrtk_ppp_rtk.c.

Referenced by ddres(), ppp_rtk_pos(), ppprtk_outstat(), and udion().

◆ INIT_ZWD

#define INIT_ZWD   0.001 /* initial ZWD (m) */

Definition at line 69 of file mrtk_ppp_rtk.c.

Referenced by relposvrs(), udtrop(), udtrop(), and udtrop().

◆ IT_RTK

#define IT_RTK ( opt)
Value:
(NP_RTK(opt) + NI_RTK(opt)) /* trop state index */
#define NI_RTK(opt)

Definition at line 108 of file mrtk_ppp_rtk.c.

Referenced by ddres(), ppprtk_outstat(), prectrop2(), and udtrop().

◆ LAM_CARR_L1

#define LAM_CARR_L1   (CLIGHT / FREQ1)

Definition at line 82 of file mrtk_ppp_rtk.c.

◆ LAM_CARR_L2

#define LAM_CARR_L2   (CLIGHT / FREQ2)

Definition at line 83 of file mrtk_ppp_rtk.c.

◆ LAM_CARR_L5

#define LAM_CARR_L5   (CLIGHT / FREQ5)

Definition at line 84 of file mrtk_ppp_rtk.c.

◆ MAXOBSLOSS_DEFAULT

#define MAXOBSLOSS_DEFAULT   300.0 /* max obs gap to reset states (s) */

Definition at line 79 of file mrtk_ppp_rtk.c.

Referenced by ppp_rtk_pos().

◆ MAXPBCORSSR

#define MAXPBCORSSR   20.0 /* max phase bias correction of SSR (m) */

Definition at line 73 of file mrtk_ppp_rtk.c.

◆ MAXREF

#define MAXREF   2 /* max iterations searching reference sat */

Definition at line 62 of file mrtk_ppp_rtk.c.

Referenced by ddres(), ddres(), ppp_rtk_pos(), and relposvrs().

◆ MIN

#define MIN ( x,
y )
Value:
((x) <= (y) ? (x) : (y))

Definition at line 60 of file mrtk_ppp_rtk.c.

◆ MINAMB_DEFAULT

#define MINAMB_DEFAULT   2 /* minimum ambiguities for AR */

Definition at line 78 of file mrtk_ppp_rtk.c.

Referenced by resamb_LAMBDA().

◆ NB_RTK

#define NB_RTK ( opt)
Value:
(MAXSAT * NF_RTK(opt))
#define NF_RTK(opt)

Definition at line 103 of file mrtk_ppp_rtk.c.

◆ NF_RTK

#define NF_RTK ( opt)
Value:
((opt)->nf)

Definition at line 98 of file mrtk_ppp_rtk.c.

Referenced by ddmat(), ddres(), holdamb(), ppp_rtk_pos(), restamb(), and udbias_ppp().

◆ NI_RTK

#define NI_RTK ( opt)
Value:
(((opt)->ionoopt == IONOOPT_EST || (opt)->ionoopt == IONOOPT_EST_ADPT) ? MAXSAT : 0)
#define IONOOPT_EST
Definition mrtk_opt.h:96
#define IONOOPT_EST_ADPT
Definition mrtk_opt.h:100

Definition at line 100 of file mrtk_ppp_rtk.c.

Referenced by udpos_ppp().

◆ NP_RTK

#define NP_RTK ( opt)
Value:
((opt)->dynamics == 0 ? 3 : 9)

Definition at line 99 of file mrtk_ppp_rtk.c.

Referenced by ppp_rtk_pos(), residual_test(), and udpos_ppp().

◆ NR_RTK

#define NR_RTK ( opt)
Value:
(NP_RTK(opt) + NI_RTK(opt) + NT_RTK(opt))
#define NT_RTK(opt)

Definition at line 102 of file mrtk_ppp_rtk.c.

Referenced by ppp_rtk_na().

◆ NT_RTK

#define NT_RTK ( opt)
Value:
((opt)->tropopt < TROPOPT_EST ? 0 : ((opt)->tropopt < TROPOPT_ESTG ? 1 : 3))
#define TROPOPT_EST
Definition mrtk_opt.h:105
#define TROPOPT_ESTG
Definition mrtk_opt.h:106

Definition at line 101 of file mrtk_ppp_rtk.c.

◆ NX_RTK

#define NX_RTK ( opt)
Value:
(NR_RTK(opt) + NB_RTK(opt))
#define NB_RTK(opt)

Definition at line 104 of file mrtk_ppp_rtk.c.

Referenced by ppp_rtk_nx().

◆ SQR

#define SQR ( x)
Value:
((x) * (x))

Definition at line 58 of file mrtk_ppp_rtk.c.

Referenced by ddres(), ppp_rtk_pos(), residual_test(), set_init_pb(), udbias_ppp(), udion(), udpos_ppp(), and udtrop().

◆ SQRT

#define SQRT ( x)
Value:
((x) <= 0.0 || (x) != (x) ? 0.0 : sqrt(x))

Definition at line 59 of file mrtk_ppp_rtk.c.

◆ VAR_ACC

#define VAR_ACC   SQR(1.0) /* initial variance of receiver acc (m/ss)^2 */

Definition at line 67 of file mrtk_ppp_rtk.c.

◆ VAR_GRA

#define VAR_GRA   SQR(0.001) /* gradient variance (m^2) */

Definition at line 68 of file mrtk_ppp_rtk.c.

◆ VAR_POS

#define VAR_POS   SQR(30.0) /* initial variance of receiver pos (m^2) */

Definition at line 65 of file mrtk_ppp_rtk.c.

◆ VAR_VEL

#define VAR_VEL   SQR(1.0) /* initial variance of receiver vel (m/s)^2 */

Definition at line 66 of file mrtk_ppp_rtk.c.

◆ VARHOLDAMB

#define VARHOLDAMB   0.001 /* hold-ambiguity constraint variance */

Definition at line 76 of file mrtk_ppp_rtk.c.

Referenced by holdamb().

Enumeration Type Documentation

◆ ddres_order

Order in which ddres() is called within one ppp_rtk_pos() epoch

Enumerator
FST 
SND 
TRD 

Definition at line 1439 of file mrtk_ppp_rtk.c.

Function Documentation

◆ calpdop()

double calpdop ( const rtk_t * rtk,
const double * H,
const double * azel,
const int * vflg,
const obsd_t * obs,
double elmask,
int n,
int nv )
static

Definition at line 2258 of file mrtk_ppp_rtk.c.

References rtk_t::opt, prcopt_t::refdop, sddop(), and zddop().

Referenced by ppp_rtk_pos().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ check_clas_facility()

void check_clas_facility ( nav_t * nav,
const clas_ctx_t * clas,
const clas_grid_t * grid,
const prcopt_t * opt )
static

Definition at line 2500 of file mrtk_ppp_rtk.c.

References clas_ctx_t::current, clas_corr_t::facility, nav_s::filreset, prcopt_t::l6mrg, SSR_CH_NUM, and clas_corr_t::use.

Referenced by ppp_rtk_pos().

Here is the caller graph for this function:

◆ check_same_fac()

int check_same_fac ( const clas_ctx_t * clas)
static

Test whether the two L6 channels currently carry the same facility.

When both channels carry the same facility, either of them can supply any satellite, so the reference satellite and each non-reference satellite may pick their channel independently. With different facilities the two correction sets are not interchangeable and the DD has to be kept within one channel unless a common reference satellite exists.

Mirrors upstream check_same_fac(), which compares the facility id of the two CurrentCSSR entries directly.

Parameters
[in]clasCLAS context
Returns
1 if both channels report the same facility, 0 otherwise

Definition at line 1456 of file mrtk_ppp_rtk.c.

References clas_ctx_t::current, and clas_corr_t::facility.

Referenced by ddres().

Here is the caller graph for this function:

◆ ddcov()

void ddcov ( const int * nb,
int n,
const double * Ri,
const double * Rj,
int nv,
double * R )
static

Build DD covariance from SD variances.

Parameters
[in]nbBlock sizes array
[in]nNumber of blocks
[in]RiReference satellite variances
[in]RjNon-reference satellite variances
[in]nvTotal number of DD observations
[out]RDD covariance matrix (nv x nv)

Definition at line 1062 of file mrtk_ppp_rtk.c.

Referenced by ddres().

Here is the caller graph for this function:

◆ ddmat()

int ddmat ( rtk_t * rtk,
double * D,
int * indI,
int * indJ )
static

Build SD-to-DD transformation matrix D.

Parameters
[in,out]rtkRTK control struct
[out]DTransformation matrix (nx x nx)
[out]indIReference satellite bias indices
[out]indJNon-reference satellite bias indices
Returns
Number of DD ambiguities (nb)

Definition at line 1977 of file mrtk_ppp_rtk.c.

References ssat_t::azel, ssat_t::code, prcopt_t::elmaskar, ssat_t::fix, prcopt_t::glomodear, ssat_t::lock, MAXSAT, rtk_t::na, NF_RTK, rtk_t::nx, rtk_t::opt, prcopt_t::qzsmodear, ssat_t::slip, rtk_t::ssat, ssat_t::sys, test_sys(), trace(), tracemat(), ssat_t::vsat, and rtk_t::x.

Referenced by resamb_LAMBDA().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ddres()

int ddres ( rtk_t * rtk,
const nav_t * nav,
double * x,
double ** pbslip,
const double * P,
const obsd_t * obs,
double ** y,
double * e,
double * azel,
int n,
double * v,
double * H,
double * R,
int * vflg,
int niter,
int pch,
int order )
static

Compute DD residuals and measurement matrix, merging L6 channels.

With opt->l6mrg set, residuals of both L6 channels are supplied and merged: the reference satellite is preferentially one that both channels observe, each non-reference satellite is assigned to a channel (priority channel for l6mrg==1, load-balanced otherwise) with a fallback to the other channel, and a satellite that changes channel has its phase bias re-initialized — only when the channels carry different facilities: same-facility channels share the correction basis, so a switch does not break phase-bias continuity. With l6mrg clear only y[0]/pbslip[0] are read and the merge logic is bypassed.

Parameters
[in,out]rtkRTK control struct
[in]navNavigation data
[in]xState vector
[in,out]pbslipPer-channel phase bias slip corrections (NULL for postfit)
[in]PCovariance matrix (may be NULL)
[in]obsObservation data
[in]yPer-channel ZD residuals
[in]eLine-of-sight vectors (3*n)
[in]azelAzimuth/elevation (2*n)
[in]nNumber of observations
[out]vDD residuals
[out]HMeasurement matrix (may be NULL)
[out]RMeasurement covariance
[out]vflgResidual flags
[in]niterReference satellite search iteration
[in]pchPriority L6 channel
[in]orderCall order within the epoch (FST/SND/TRD)
Returns
Number of DD residuals

Definition at line 1597 of file mrtk_ppp_rtk.c.

References check_same_fac(), nav_s::clas_ctx, ssat_t::code, ddcov(), ecef2pos(), free, freq_idx2freq_num(), FST, prcopt_t::glomodear, IB_RTK, II_RTK, ionmapf(), prcopt_t::ionoopt, IONOOPT_EST, IONOOPT_EST_ADPT, IT_RTK, prcopt_t::l6mrg, lam_carr, mat(), MAXREF, MAXSAT, prcopt_t::mode, NF_RTK, rtk_t::nx, rtk_t::opt, PMODE_DGPS, prectrop2(), prtk_ctx, prcopt_t::qzsmodear, ssat_t::resc, ssat_t::resp, obsd_t::sat, set_init_pb(), rtk_t::sol, SQR, rtk_t::ssat, nav_s::ssr_ch, SSR_CH_NUM, ssat_t::sys, ssr_t::t0, test_sys(), sol_t::time, time_str(), timediff(), trace(), prcopt_t::tropopt, TROPOPT_EST, TROPOPT_ESTG, valid_zd_sig(), validobs(), varerr(), ssat_t::vs, and ssat_t::vsat.

Referenced by ppp_rtk_pos().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ detslp_gf()

void detslp_gf ( rtk_t * rtk,
const obsd_t * obs,
int n,
const nav_t * nav )
static

Detect cycle slip by geometry-free phase jump.

Parameters
[in,out]rtkRTK control struct
[in]obsObservation data
[in]nNumber of observations
[in]navNavigation data

Definition at line 804 of file mrtk_ppp_rtk.c.

References ssat_t::gf, gfmeas_L1L2(), gfmeas_L1L5(), MAXOBS, prcopt_t::nf, rtk_t::opt, obsd_t::sat, ssat_t::slip, rtk_t::ssat, prcopt_t::thresslip, and trace().

Referenced by udbias_ppp().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ detslp_ll()

void detslp_ll ( rtk_t * rtk,
const obsd_t * obs,
int n )
static

Detect cycle slip by LLI flag.

Parameters
[in,out]rtkRTK control struct
[in]obsObservation data
[in]nNumber of observations

Definition at line 751 of file mrtk_ppp_rtk.c.

References MAXOBS, prcopt_t::nf, rtk_t::opt, obsd_t::sat, ssat_t::slip, rtk_t::ssat, and trace().

Referenced by udbias_ppp().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ elsort()

void elsort ( rtk_t * rtk,
const obsd_t * obs,
int * isat,
double * el,
int n )
static

Sort satellites by elevation angle (ascending) for partial AR.

Parameters
[in]rtkRTK control struct
[in]obsObservation data array
[out]isatSorted satellite numbers
[out]elSorted elevation angles (rad)
[in]nNumber of observations

Definition at line 2178 of file mrtk_ppp_rtk.c.

References ssat_t::azel, obsd_t::sat, and rtk_t::ssat.

Referenced by ppp_rtk_pos().

Here is the caller graph for this function:

◆ filter2()

int filter2 ( rtk_t * rtk,
double * x,
double * P,
const double * H,
const double * v,
const double * R,
const int n,
const int m,
const int * vflg,
const int flg )
static

KF measurement update with state compaction.

Compacts the state vector to exclude zero/invalid states before calling the inner filter, then maps results back.

Parameters
[in,out]rtkRTK control struct
[in,out]xState vector (n)
[in,out]PCovariance matrix (n x n)
[in]HObservation matrix (n x m)
[in]vResidual vector (m)
[in]RMeasurement noise (m x m)
[in]nNumber of states
[in]mNumber of measurements
[in]vflgResidual flags
[in]flgStage flag
Returns
0 on success, non-zero on error

Definition at line 1370 of file mrtk_ppp_rtk.c.

References filter2_(), free, imat(), prcopt_t::ionoopt, IONOOPT_EST_ADPT, mat(), rtk_t::opt, prcopt_t::prnadpt, prtk_ctx, and zeros().

Referenced by ppp_rtk_pos().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ filter2_()

int filter2_ ( rtk_t * rtk,
const double * x,
const double * P,
const double * H,
const double * v,
const double * R,
const int n,
const int m,
double * xp,
double * Pp,
double * Qp,
const int * vflg,
const int flg )
static

Inner KF measurement update with residual test.

Parameters
[in,out]rtkRTK control struct
[in]xState vector (n)
[in]PCovariance matrix (n x n)
[in]HObservation matrix (n x m)
[in]vResidual vector (m)
[in]RMeasurement noise (m x m)
[in]nNumber of states
[in]mNumber of measurements
[out]xpUpdated state vector (n)
[out]PpUpdated covariance (n x n)
[in]vflgResidual flags
[in]flgStage flag (0:prefit, 1+:postfit)
Returns
0 on success, non-zero on error

Definition at line 1268 of file mrtk_ppp_rtk.c.

References eye(), free, imat(), prcopt_t::ionoopt, IONOOPT_EST_ADPT, mat(), matcpy(), matinv(), matmul(), rtk_t::opt, prcopt_t::prnadpt, prtk_ctx, Qp, residual_test(), and trace().

Referenced by filter2().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gfmeas_L1L2()

double gfmeas_L1L2 ( const obsd_t * obs,
const nav_t * nav )
static

L1/L2 geometry-free phase measurement.

Definition at line 772 of file mrtk_ppp_rtk.c.

References obsd_t::L, obsd_t::sat, and sat_lambda().

Referenced by detslp_gf().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gfmeas_L1L5()

double gfmeas_L1L5 ( const obsd_t * obs,
const nav_t * nav )
static

L1/L5 geometry-free phase measurement.

Definition at line 784 of file mrtk_ppp_rtk.c.

References obsd_t::L, obsd_t::sat, and sat_lambda().

Referenced by detslp_gf().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ holdamb()

void holdamb ( rtk_t * rtk,
const double * xa )
static

Hold fixed ambiguities via pseudomeasurement constraint.

Parameters
[in,out]rtkRTK control struct
[in]xaFixed state vector

Definition at line 2110 of file mrtk_ppp_rtk.c.

References ssat_t::azel, ssat_t::code, prcopt_t::elmaskhold, filter(), ssat_t::fix, free, prcopt_t::glomodear, IB_RTK, mat(), MAXSAT, rtk_t::na, NF_RTK, rtk_t::nx, rtk_t::opt, rtk_t::P, prcopt_t::qzsmodear, rtk_t::ssat, ssat_t::sys, test_sys(), trace(), VARHOLDAMB, prcopt_t::varholdamb, ssat_t::vsat, rtk_t::x, and zeros().

Referenced by ppp_rtk_pos().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ initx()

void initx ( rtk_t * rtk,
double xi,
double var,
int i )
static

Initialize a state and its covariance.

Parameters
[in,out]rtkRTK control struct
[in]xiInitial state value
[in]varInitial variance
[in]iState index

Definition at line 384 of file mrtk_ppp_rtk.c.

References rtk_t::nx, rtk_t::P, and rtk_t::x.

Referenced by set_init_pb(), udbias_ppp(), udion(), udpos_ppp(), and udtrop().

Here is the caller graph for this function:

◆ load_ppp_osr_cpc()

void load_ppp_osr_cpc ( clas_osr_ctx_t * ctx,
const double * cpc,
const gtime_t * pt0 )
static

Definition at line 199 of file mrtk_ppp_rtk.c.

References cpc, clas_osr_ctx_t::cpctmp, MAXSAT, pt0, and clas_osr_ctx_t::pt0tmp.

Referenced by ppp_rtk_pos().

Here is the caller graph for this function:

◆ obs_code_for_freq()

uint8_t obs_code_for_freq ( int sat,
int f )
static

Return default observation code for frequency index and system.

Parameters
[in]satSatellite number
[in]fFrequency index (0=L1, 1=L2, 2=L5)
Returns
Observation code (CODE_L*)

Definition at line 235 of file mrtk_ppp_rtk.c.

References CODE_L1C, CODE_L2I, CODE_L2W, CODE_L5Q, CODE_L6I, CODE_L7I, satsys(), SYS_CMP, SYS_GAL, SYS_GPS, and SYS_QZS.

Referenced by sat_lambda().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ppp_rtk_na()

int ppp_rtk_na ( const prcopt_t * opt)
extern

Compute number of non-ambiguity states for PPP-RTK.

Parameters
[in]optProcessing options
Returns
Number of non-ambiguity states (position + iono + trop)

Definition at line 2498 of file mrtk_ppp_rtk.c.

References NR_RTK.

Referenced by rtkinit().

Here is the caller graph for this function:

◆ ppp_rtk_nx()

int ppp_rtk_nx ( const prcopt_t * opt)
extern

Compute number of estimated states for PPP-RTK.

Parameters
[in]optProcessing options
Returns
Total number of states

Definition at line 2496 of file mrtk_ppp_rtk.c.

References NX_RTK.

Referenced by rtkinit().

Here is the caller graph for this function:

◆ ppp_rtk_pos()

void ppp_rtk_pos ( rtk_t * rtk,
const obsd_t * obs,
int n,
nav_t * nav )
extern

PPP-RTK positioning for one epoch (CLAS).

Main entry point for the CLAS PPP-RTK positioning engine. Uses double-differencing with CLAS grid corrections (STEC, ZWD) and iterative Kalman filter with LAMBDA integer ambiguity resolution.

Uses CLAS grid corrections with a short CSSR backup fallback matching claslib.

Parameters
[in,out]rtkRTK control/result struct
[in]obsObservation data for epoch
[in]nNumber of observations
[in,out]navNavigation data (includes SSR via nav->ssr_ch[][])

Definition at line 2540 of file mrtk_ppp_rtk.c.

References prcopt_t::afgainion, prcopt_t::afgainpva, sol_t::age, prcopt_t::arfilter, prcopt_t::armaxdelsat, ARMODE_FIXHOLD, calpdop(), check_clas_facility(), clas_backup_current(), clas_backup_valid(), clas_bank_get_close(), clas_check_grid_status(), clas_clear_current(), nav_s::clas_ctx, clas_get_grid_index(), clas_osr_satcorr_update(), clas_osr_zdres(), clas_restore_backup(), clas_update_global(), clas_update_local(), clas_ctx_t::current, ddres(), prcopt_t::dynamics, ecef2pos(), prcopt_t::elmaskar, prcopt_t::elmaskhold, elsort(), nav_s::filreset, filter2(), ssat_t::fix, prcopt_t::floatcnt, prcopt_t::forgetion, prcopt_t::forgetpva, free, FST, clas_ctx_t::grid, prcopt_t::gridsel, holdamb(), II_RTK, prcopt_t::ionoopt, IONOOPT_EST_ADPT, obsd_t::L, clas_ctx_t::l6buf, prcopt_t::l6mrg, load_ppp_osr_cpc(), ssat_t::lock, mat(), matcpy(), prcopt_t::maxdiffp, prcopt_t::maxinno_ext, MAXOBS, MAXOBSLOSS_DEFAULT, prcopt_t::maxobsloss_s, prcopt_t::maxpdopar, prcopt_t::maxpdophold, MAXREF, MAXSAT, prcopt_t::minfix, prcopt_t::minlock, prcopt_t::mode, prcopt_t::modear, rtk_t::na, clas_grid_t::network, prcopt_t::nf, NF_RTK, rtk_t::nfix, prcopt_t::niter, norm(), NP_RTK, NR_RTK, sol_t::ns, rtk_t::nx, rtk_t::opt, ssat_t::outc, rtk_t::P, rtk_t::Pa, ssat_t::ph, PMODE_DGPS, prcopt_t::poserrcnt, prcopt_t::posopt, prcopt_t::prnadpt, prtk_ctx, ssat_t::pt, rtk_t::Q, sol_t::qr, R2D, sol_t::ratio, obsd_t::rcv, prcopt_t::regularly, resamb_LAMBDA(), sol_t::rr, obsd_t::sat, prcopt_t::sateph, satposs(), satsys(), save_ppp_osr_cpc(), set_ssr_ch_idx(), ssat_t::slip, ssat_t::slipc, SND, obsd_t::SNR, ssat_t::snr, rtk_t::sol, SOLQ_DGPS, SOLQ_FIX, SOLQ_FLOAT, SOLQ_NONE, SOLQ_SINGLE, SQR, rtk_t::ssat, nav_s::ssr_ch, SSR_CH_NUM, sol_t::stat, ssat_t::sys, ssr_t::t0, prcopt_t::thresar, clas_l6buf_t::time, gtime_t::time, obsd_t::time, sol_t::time, time2gpst(), time_str(), timediff(), trace(), tracemat(), TRD, rtk_t::tt, udstate_ppp(), ssat_t::vsat, rtk_t::x, rtk_t::xa, and zeros().

Referenced by rtkpos().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ppprtk_outstat()

int ppprtk_outstat ( rtk_t * rtk,
char * buff )
extern

Write PPP-RTK solution status to buffer.

PPP-RTK uses a different state layout from standard PPP (no clock states, iono at NP, trop at NP+NI). This function outputs state information using the correct PPP-RTK indices (II_RTK, IT_RTK, IB_RTK).

Parameters
[in,out]rtkRTK control/result struct
[out]buffOutput buffer
Returns
Number of bytes written

Definition at line 2423 of file mrtk_ppp_rtk.c.

References ssat_t::azel, prcopt_t::dynamics, ecef2enu(), ecef2pos(), II_RTK, prcopt_t::ionoopt, IONOOPT_EST, IONOOPT_EST_ADPT, IT_RTK, MAXSAT, rtk_t::nx, rtk_t::opt, rtk_t::P, R2D, sol_t::rr, satno2id(), rtk_t::sol, SOLQ_FIX, SQRT, rtk_t::ssat, sol_t::stat, sol_t::time, time2gpst(), prcopt_t::tropopt, TROPOPT_EST, TROPOPT_ESTG, ssat_t::vs, rtk_t::x, and rtk_t::xa.

Referenced by pppoutstat().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ prectrop2()

double prectrop2 ( gtime_t time,
const double * pos,
int r,
const double * azel,
const prcopt_t * opt,
const double * x,
double * dtdx )
static

Compute precise tropospheric delay for KF.

Parameters
[in]timeObservation time
[in]posReceiver position (lat/lon/hgt)
[in]rUnused (receiver index, always 0)
[in]azelAzimuth/elevation (rad)
[in]optProcessing options
[in]xState vector
[out]dtdxPartial derivatives [3]
Returns
Tropospheric delay (m)

Definition at line 1008 of file mrtk_ppp_rtk.c.

References IT_RTK, tropmapf(), prcopt_t::tropopt, and TROPOPT_ESTG.

Referenced by ddres().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ resamb_LAMBDA()

int resamb_LAMBDA ( rtk_t * rtk,
double * bias,
double * xa )
static

Resolve integer ambiguity by LAMBDA.

Parameters
[in,out]rtkRTK control struct
[out]biasDD fixed ambiguity biases
[out]xaFixed state vector
Returns
Number of resolved ambiguities (0 = failed)

Definition at line 2280 of file mrtk_ppp_rtk.c.

References prcopt_t::alphaar, ALPHAAR_DEFAULT, ARMODE_OFF, ddmat(), free, lambda(), mat(), matinv(), matmul(), MAXOBS, prcopt_t::minamb, MINAMB_DEFAULT, prcopt_t::mode, prcopt_t::modear, rtk_t::na, rtk_t::nx, rtk_t::opt, rtk_t::P, rtk_t::Pa, PMODE_DGPS, qf, sol_t::ratio, restamb(), rtk_t::sol, trace(), tracemat(), rtk_t::x, rtk_t::xa, and zeros().

Referenced by ppp_rtk_pos(), and relposvrs().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ residual_test()

int residual_test ( rtk_t * rtk,
const int * vflg,
const double * v,
const double * Q,
int * iv,
const int m,
int * ns,
const int flg )
static

Validate residuals and reject outliers.

Parameters
[in,out]rtkRTK control struct
[in]vflgResidual flags (sat/type/freq encoded)
[in]vResidual vector
[in]QInnovation covariance matrix (m x m)
[out]ivIndices of valid residuals
[in]mTotal number of residuals
[out]nsCount per frequency/type
[in]flgStage flag (0:prefit, 1:postfit float, 2:postfit fix)
Returns
Number of valid residuals

Definition at line 1123 of file mrtk_ppp_rtk.c.

References chisqr, free, FREQ1, FREQ2, lam_carr, prcopt_t::maxinno, prcopt_t::maxinno_ext, MAXSAT, prcopt_t::nf, NP_RTK, rtk_t::opt, ssat_t::outc, prtk_ctx, ssat_t::rejc, SQR, rtk_t::ssat, trace(), ssat_t::vsat, and zeros().

Referenced by filter2_().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ restamb()

void restamb ( rtk_t * rtk,
const double * bias,
int nb,
double * xa )
static

Restore SD ambiguities from DD fixed values.

Parameters
[in,out]rtkRTK control struct
[in]biasDD ambiguity biases
[in]nbNumber of DD ambiguities
[out]xaFixed state vector

Definition at line 2055 of file mrtk_ppp_rtk.c.

References ssat_t::code, ssat_t::fix, prcopt_t::glomodear, IB_RTK, ssat_t::lock, MAXSAT, rtk_t::na, NF_RTK, rtk_t::nx, rtk_t::opt, prcopt_t::qzsmodear, rtk_t::ssat, ssat_t::sys, test_sys(), trace(), rtk_t::x, and rtk_t::xa.

Referenced by resamb_LAMBDA().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rtkfree_ppp_rtk()

void rtkfree_ppp_rtk ( rtk_t * rtk)
extern

Free RTK control struct for PPP-RTK positioning.

Parameters
[in,out]rtkRTK control struct

Definition at line 3223 of file mrtk_ppp_rtk.c.

References prtk_ctx, and trace().

Here is the call graph for this function:

◆ rtkinit_ppp_rtk()

void rtkinit_ppp_rtk ( rtk_t * rtk,
const prcopt_t * opt )
extern

Initialize RTK control struct for PPP-RTK positioning.

Parameters
[in,out]rtkRTK control struct
[in]optProcessing options

Definition at line 3205 of file mrtk_ppp_rtk.c.

References prtk_ctx, and trace().

Here is the call graph for this function:

◆ sat_lambda()

double sat_lambda ( int sat,
int f,
const nav_t * nav )
static

Compute satellite-specific wavelength for frequency index.

Uses direct obs code to frequency mapping, bypassing obsdef tables which may be rearranged by apply_pppsig() for MADOCA PPP signal selection.

Parameters
[in]satSatellite number
[in]fFrequency index (0,1,2)
[in]navNavigation data (unused, kept for API compatibility)
Returns
Wavelength in meters, or 0.0 if invalid

Definition at line 274 of file mrtk_ppp_rtk.c.

References CLIGHT, code2obs(), FREQ1, FREQ2, FREQ5, FREQ6, FREQ7, FREQ8, freq_idx2freq_num(), freq_num2freq(), nav_s::glo_fcn, obs_code_for_freq(), satsys(), and SYS_GLO.

Referenced by gfmeas_L1L2(), gfmeas_L1L5(), set_init_pb(), udbias_ppp(), and valid_zd_sig().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ save_ppp_osr_cpc()

void save_ppp_osr_cpc ( const clas_osr_ctx_t * ctx,
double * cpc,
gtime_t * pt0 )
static

Definition at line 212 of file mrtk_ppp_rtk.c.

References cpc, clas_osr_ctx_t::cpctmp, MAXSAT, pt0, and clas_osr_ctx_t::pt0tmp.

Referenced by ppp_rtk_pos().

Here is the caller graph for this function:

◆ sddop()

double sddop ( const rtk_t * rtk,
const double * H,
const int * vflg,
double elmask,
int nv )
static

Definition at line 2211 of file mrtk_ppp_rtk.c.

References ssat_t::azel, free, mat(), matinv(), matmul(), rtk_t::nx, rtk_t::ssat, and ssat_t::vsat.

Referenced by calpdop().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_init_pb()

void set_init_pb ( rtk_t * rtk,
const nav_t * nav,
const obsd_t * obs,
int n,
int f,
int satj )
static

Re-initialize the phase-bias state of one satellite from phase-code.

Used when a satellite switches L6 channel: the accumulated bias belongs to the previous channel's correction set and must not carry over. Mirrors the second half of udbias_ppp(), restricted to a single satellite.

Parameters
[in,out]rtkRTK control struct
[in]navNavigation data
[in]obsObservation data
[in]nNumber of observations
[in]fFrequency index
[in]satjSatellite to reset

Definition at line 1523 of file mrtk_ppp_rtk.c.

References free, IB_RTK, initx(), obsd_t::L, ssat_t::lock, prcopt_t::minlock, rtk_t::opt, obsd_t::P, ssat_t::pbreset, obsd_t::sat, sat_lambda(), SQR, rtk_t::ssat, prcopt_t::std, trace(), rtk_t::x, and zeros().

Referenced by ddres().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ test_sys()

int test_sys ( int sys,
int m,
int qzsmodear,
int code )
static

Test if satellite system matches group index.

Parameters
[in]sysSatellite system (SYS_*)
[in]mGroup index (0:GPS/SBS, 1:GLO, 2:GAL, 3:BDS, 4:QZS, 5:GPS-L2C)
[in]qzsmodearQZSS AR mode (0:off, 1:on, 2:gps-qzs)
[in]codeObservation code indicator (CODE_*)
Returns
1 if match, 0 otherwise

Definition at line 1089 of file mrtk_ppp_rtk.c.

References CODE_L2X, SYS_CMP, SYS_GAL, SYS_GLO, SYS_GPS, SYS_QZS, and SYS_SBS.

Referenced by ddidx(), ddmat(), ddmat(), ddres(), holdamb(), restamb(), and valid_zd_sig().

Here is the caller graph for this function:

◆ udbias_ppp()

void udbias_ppp ( rtk_t * rtk,
double tt,
const obsd_t * obs,
int n,
const nav_t * nav )
static

Temporal update of phase biases.

Parameters
[in,out]rtkRTK control struct
[in]ttTime step (s)
[in]obsObservation data
[in]nNumber of observations
[in]navNavigation data

Definition at line 856 of file mrtk_ppp_rtk.c.

References ARMODE_INST, detslp_gf(), detslp_ll(), free, IB_RTK, initx(), prcopt_t::ionoopt, IONOOPT_IFLC, obsd_t::L, ssat_t::lock, MAXOBS, prcopt_t::maxout, MAXSAT, prcopt_t::minlock, prcopt_t::modear, prcopt_t::nf, NF_RTK, rtk_t::nx, rtk_t::opt, ssat_t::outc, obsd_t::P, rtk_t::P, ssat_t::pbreset, prcopt_t::prn, prtk_ctx, obsd_t::sat, sat_lambda(), ssat_t::slip, SQR, rtk_t::ssat, prcopt_t::std, trace(), rtk_t::x, and zeros().

Referenced by udstate_ppp().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ udion()

void udion ( rtk_t * rtk,
double tt,
double bl,
const obsd_t * obs,
int ns )
static

Temporal update of ionospheric parameters.

Parameters
[in,out]rtkRTK control struct
[in]ttTime step (s)
[in]blBaseline length (m)
[in]obsObservation data
[in]nsNumber of observations

Definition at line 679 of file mrtk_ppp_rtk.c.

References ssat_t::azel, clas_osr_selfreqpair(), II_RTK, initx(), prcopt_t::ionoopt, IONOOPT_EST_ADPT, prcopt_t::maxout, MAXSAT, prcopt_t::nf, rtk_t::nx, rtk_t::opt, ssat_t::outc, rtk_t::P, prcopt_t::prn, prcopt_t::prnionomax, rtk_t::Q, obsd_t::sat, SQR, rtk_t::ssat, prcopt_t::std, trace(), and rtk_t::x.

Referenced by udstate_ppp().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ udpos_ppp()

void udpos_ppp ( rtk_t * rtk,
const obsd_t * obs,
int n,
double tt )
static

Temporal update of position states.

Parameters
[in,out]rtkRTK control struct
[in]obsObservation data
[in]nNumber of observations
[in]ttTime step (s)

Definition at line 403 of file mrtk_ppp_rtk.c.

References covecef(), prcopt_t::dynamics, ecef2pos(), eye(), free, initx(), mat(), matcpy(), matmul(), prcopt_t::mode, NI_RTK, norm(), NP_RTK, rtk_t::nx, rtk_t::opt, rtk_t::P, PMODE_PPP_FIXED, prcopt_t::prn, sol_t::rr, prcopt_t::ru, rtk_t::sol, SQR, prcopt_t::stats_prnposith, prcopt_t::stats_prnpositv, prcopt_t::stats_tconstiono, trace(), VAR_ACC, VAR_POS, VAR_VEL, and rtk_t::x.

Referenced by udstate_ppp().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ udstate_ppp()

void udstate_ppp ( rtk_t * rtk,
const obsd_t * obs,
int n,
const nav_t * nav )
static

Temporal update of all PPP-RTK states.

Parameters
[in,out]rtkRTK control struct
[in]obsObservation data
[in]nNumber of observations
[in]navNavigation data

Definition at line 971 of file mrtk_ppp_rtk.c.

References BASELEN, prcopt_t::ionoopt, IONOOPT_EST, rtk_t::opt, trace(), prcopt_t::tropopt, TROPOPT_EST, rtk_t::tt, udbias_ppp(), udion(), udpos_ppp(), and udtrop().

Referenced by ppp_rtk_pos().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ udtrop()

void udtrop ( rtk_t * rtk,
double tt )
static

Temporal update of tropospheric parameters.

Parameters
[in,out]rtkRTK control struct
[in]ttTime step (s)

Definition at line 643 of file mrtk_ppp_rtk.c.

References INIT_ZWD, initx(), IT_RTK, rtk_t::nx, rtk_t::opt, rtk_t::P, prcopt_t::prn, SQR, prcopt_t::std, trace(), prcopt_t::tropopt, TROPOPT_ESTG, rtk_t::tt, VAR_GRA, and rtk_t::x.

Referenced by udstate_ppp().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ valid_zd_sig()

int valid_zd_sig ( rtk_t * rtk,
const obsd_t * obs,
const nav_t * nav,
double * y,
int nf,
int f,
int i,
int j,
int m,
int sati,
int * satj,
int * sysi,
int * sysj,
double * lami,
double * lamj )
static

Check that a satellite yields a usable zero-difference signal.

Validates the candidate non-reference satellite j against the reference satellite i for system m and frequency f on one L6 channel's residual vector, and reports the satellite/system/wavelength pair on success.

Parameters
[in]rtkRTK control struct
[in]obsObservation data
[in]navNavigation data
[in]yZD residuals of the channel under test
[in]nfNumber of frequencies
[in]fFrequency index (f<nf: phase, f>=nf: code)
[in]iReference satellite observation index
[in]jCandidate satellite observation index
[in]mSystem loop index
[in]satiReference satellite number
[out]satjCandidate satellite number
[out]sysiReference satellite system
[out]sysjCandidate satellite system
[out]lamiReference satellite wavelength (m)
[out]lamjCandidate satellite wavelength (m)
Returns
1 if the pair is usable, 0 otherwise

Definition at line 1482 of file mrtk_ppp_rtk.c.

References ssat_t::code, rtk_t::opt, prcopt_t::qzsmodear, obsd_t::sat, sat_lambda(), rtk_t::ssat, ssat_t::sys, test_sys(), and validobs().

Referenced by ddres().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ validobs()

int validobs ( int i,
int f,
int nf,
double * y )
static

Check if zero-difference observation is valid.

Parameters
[in]iObservation index
[in]fFrequency index (0..nf*2-1)
[in]nfNumber of frequencies
[in]yZD residual array
Returns
1 if valid, 0 otherwise

Definition at line 1045 of file mrtk_ppp_rtk.c.

Referenced by ddres(), ddres(), and valid_zd_sig().

Here is the caller graph for this function:

◆ varerr()

double varerr ( int sat,
int sys,
double el,
int type,
const prcopt_t * opt )
static

Compute measurement error variance.

Parameters
[in]satSatellite number
[in]sysSatellite system
[in]elElevation angle (rad)
[in]typeMeasurement type (0:phase, 1:code, 2:iono, 3:trop)
[in]optProcessing options
Returns
Variance (m^2)

Definition at line 334 of file mrtk_ppp_rtk.c.

References EFACT_CMP, EFACT_GAL, EFACT_GLO, EFACT_GPS, EFACT_IRN, EFACT_QZS, EFACT_SBS, prcopt_t::eratio, prcopt_t::err, prcopt_t::ionoopt, IONOOPT_EST, IONOOPT_EST_ADPT, IONOOPT_IFLC, prcopt_t::stats_erriono, prcopt_t::stats_errtrop, SYS_CMP, SYS_GAL, SYS_GLO, SYS_IRN, SYS_QZS, SYS_SBS, prcopt_t::tropopt, and TROPOPT_EST.

Referenced by ddres().

Here is the caller graph for this function:

◆ zddop()

double zddop ( const rtk_t * rtk,
const double * azel,
const obsd_t * obs,
double elmask,
int n )
static

Definition at line 2238 of file mrtk_ppp_rtk.c.

References dops(), free, mat(), obsd_t::sat, rtk_t::ssat, and ssat_t::vsat.

Referenced by calpdop().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ chisq

double chisq

Definition at line 181 of file mrtk_ppp_rtk.c.

◆ chisqr

const double chisqr[100]
static
Initial value:
= {
10.8, 13.8, 16.3, 18.5, 20.5, 22.5, 24.3, 26.1, 27.9, 29.6, 31.3, 32.9, 34.5, 36.1, 37.7, 39.3, 40.8,
42.3, 43.8, 45.3, 46.8, 48.3, 49.7, 51.2, 52.6, 54.1, 55.5, 56.9, 58.3, 59.7, 61.1, 62.5, 63.9, 65.2,
66.6, 68.0, 69.3, 70.7, 72.1, 73.4, 74.7, 76.0, 77.3, 78.6, 80.0, 81.3, 82.6, 84.0, 85.4, 86.7, 88.0,
89.3, 90.6, 91.9, 93.3, 94.7, 96.0, 97.4, 98.7, 100, 101, 102, 103, 104, 105, 107, 108, 109,
110, 112, 113, 114, 115, 116, 118, 119, 120, 122, 123, 125, 126, 127, 128, 129, 131,
132, 133, 134, 135, 137, 138, 139, 140, 142, 143, 144, 145, 147, 148, 149}

Definition at line 114 of file mrtk_ppp_rtk.c.

Referenced by residual_test(), residual_test(), and valsol().

◆ cntdiffp

int cntdiffp

Definition at line 191 of file mrtk_ppp_rtk.c.

Referenced by relposvrs().

◆ cpc

double cpc[SSR_CH_NUM][MAXSAT *5]

Definition at line 167 of file mrtk_ppp_rtk.c.

Referenced by clas_osr_adjust_cpc(), load_ppp_osr_cpc(), and save_ppp_osr_cpc().

◆ float_count

int float_count

Definition at line 188 of file mrtk_ppp_rtk.c.

◆ floatcnt_reset

int floatcnt_reset

Definition at line 194 of file mrtk_ppp_rtk.c.

◆ initialized

int initialized

Definition at line 196 of file mrtk_ppp_rtk.c.

◆ lam_carr

const double lam_carr[3] = { (CLIGHT / FREQ1) , (CLIGHT / FREQ2) , (CLIGHT / FREQ5) }
static

Definition at line 86 of file mrtk_ppp_rtk.c.

Referenced by ddres(), ddres(), residual_test(), and residual_test().

◆ osr_ctx

◆ pre_use_ch

int pre_use_ch[5][MAXSAT+1]

Definition at line 175 of file mrtk_ppp_rtk.c.

Referenced by ddres().

◆ [struct]

◆ pt0

Definition at line 168 of file mrtk_ppp_rtk.c.

Referenced by load_ppp_osr_cpc(), and save_ppp_osr_cpc().

◆ qf

const double qf[6][60]
static

Definition at line 125 of file mrtk_ppp_rtk.c.

Referenced by resamb_LAMBDA().

◆ Qp

double* Qp

Definition at line 184 of file mrtk_ppp_rtk.c.

Referenced by filter2_(), filter2_(), and relposvrs().

◆ Qp_nx

int Qp_nx

Definition at line 185 of file mrtk_ppp_rtk.c.

◆ refsat

int refsat[5 *2 *2 *6+1]

Definition at line 162 of file mrtk_ppp_rtk.c.

Referenced by ddres().

◆ refsat2

int refsat2[5 *2 *6+1]

Definition at line 163 of file mrtk_ppp_rtk.c.

Referenced by ddres().

◆ use_ch

int use_ch[5][MAXSAT+1]

Definition at line 174 of file mrtk_ppp_rtk.c.

Referenced by ddres().