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

MRTKLIB Navigation Module — Implementation. More...

#include "mrtklib/mrtk_nav.h"
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "mrtklib/mrtk_const.h"
#include "mrtklib/mrtk_opt.h"
#include "mrtklib/mrtk_trace.h"
Include dependency graph for mrtk_nav.c:

Go to the source code of this file.

Classes

struct  obsdef_t

Macros

#define SQR(x)
#define MAX_VAR_EPH   SQR(300.0) /* max variance eph to reject satellite (m^2) */
#define NBDSTBL   (MAXPRNCMP < 63 ? 64 : MAXPRNCMP + 1) /* table size, also valid when ENACMP is undefined */

Functions

int satno (int sys, int prn)
 Convert satellite system+prn/slot number to satellite number.
int satsys (int sat, int *prn)
 Convert satellite number to satellite system.
int satsys_bd2 (int sat, int *prn)
 Distinguish BDS-2 from BDS-3.
static int parse_bdslist (const char *str, int maxprn, uint8_t val, uint8_t *list)
int set_bds2prn (const char *str)
 Set the BDS-2 satellites in BeiDou PRN 1-18.
int is_bds2prn (int prn)
 Test whether a BeiDou PRN is BDS-2 (see set_bds2prn()).
int set_bds3igso (const char *str)
 Set the BDS-3 IGSO satellites (excluded as PPP-AR reference satellite).
int is_bds3igso (int prn)
 Test whether a BeiDou PRN is listed as BDS-3 IGSO (see set_bds3igso()).
int bds_gen (int prn)
 BeiDou generation of a PRN.
int set_bdsopt (const prcopt_t *opt, int warn)
 Apply the BeiDou PRN-reassignment options process-wide.
static obsdef_t * get_obsdef (int sys)
static obsdef_t * get_obsdef_default (int sys)
static void save_obsdef_defaults (void)
void reset_obsdef (void)
 Reset all obsdef tables to their pristine default frequency layout.
void set_obsdef (int sys, const int *freq_nums)
 Rearrange obsdef table for a satellite system by frequency numbers.
void apply_pppsig (const int *pppsig)
 Apply PPP signal selection options to obsdef tables.
void apply_claslib_ppprtk_obsdef (void)
 Apply the upstream claslib PPP-RTK observation slot layout.
int freq_idx2freq_num (int sys, int freq_idx)
 Convert frequency index to frequency number using obsdef table.
int freq_num2freq_idx (int sys, int freq_num)
 Convert frequency number to frequency index using obsdef table.
double freq_num2freq (int sys, int freq_num, int fcn)
 Convert frequency number to frequency in Hz.
int freq_num2ant_idx (int sys, int freq_num)
 Convert frequency number to antenna PCV index.
int freq_idx2ant_idx (int sys, int freq_idx)
 Convert frequency index to antenna PCV index.
int satid2no (const char *id)
 Convert satellite id to satellite number.
void satno2id (int sat, char *id)
 Convert satellite number to satellite id.
static int cmpeph (const void *p1, const void *p2)
static void uniqeph (nav_t *nav)
static int cmpgeph (const void *p1, const void *p2)
static void uniqgeph (nav_t *nav)
static int cmpseph (const void *p1, const void *p2)
static void uniqseph (nav_t *nav)
void uniqnav (nav_t *nav)
 Unique ephemerides in navigation data.
int readnav (const char *file, nav_t *nav)
 Read navigation data from file.
int savenav (const char *file, const nav_t *nav)
 Save navigation data to file.
void freenav (nav_t *nav, int opt)
 Free navigation data memory.
int satexclude (int sat, double var, int svh, const struct prcopt_t *opt)
 Test excluded satellite.

Variables

static uint8_t bdsgen_ [(MAXPRNCMP< 63 ? 64 :MAXPRNCMP+1)] = {0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3}
static uint8_t bds3igso_ [(MAXPRNCMP< 63 ? 64 :MAXPRNCMP+1)] = {0, 0, 0, 0, 0, 0, 1, 1, 1}
static obsdef_t obsdef_GPS [MAXFREQ]
static obsdef_t obsdef_GLO [MAXFREQ]
static obsdef_t obsdef_GAL [MAXFREQ]
static obsdef_t obsdef_QZS [MAXFREQ]
static obsdef_t obsdef_SBS [MAXFREQ]
static obsdef_t obsdef_BDS [MAXFREQ]
static obsdef_t obsdef_BD2 [MAXFREQ]
static obsdef_t obsdef_IRN [MAXFREQ]
static obsdef_t obsdef_GPS_def [MAXFREQ]
static obsdef_t obsdef_GLO_def [MAXFREQ]
static obsdef_t obsdef_GAL_def [MAXFREQ]
static obsdef_t obsdef_QZS_def [MAXFREQ]
static obsdef_t obsdef_SBS_def [MAXFREQ]
static obsdef_t obsdef_BDS_def [MAXFREQ]
static obsdef_t obsdef_BD2_def [MAXFREQ]
static obsdef_t obsdef_IRN_def [MAXFREQ]
static int obsdef_defaults_saved = 0

Detailed Description

MRTKLIB Navigation Module — Implementation.

All functions and static data in this file are cut-and-paste extractions from the legacy rtkcmn.c with zero algorithmic changes.

Definition in file mrtk_nav.c.

Macro Definition Documentation

◆ MAX_VAR_EPH

#define MAX_VAR_EPH   SQR(300.0) /* max variance eph to reject satellite (m^2) */

Definition at line 46 of file mrtk_nav.c.

Referenced by satexclude().

◆ NBDSTBL

#define NBDSTBL   (MAXPRNCMP < 63 ? 64 : MAXPRNCMP + 1) /* table size, also valid when ENACMP is undefined */

Definition at line 180 of file mrtk_nav.c.

Referenced by set_bds2prn(), and set_bds3igso().

◆ SQR

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

Definition at line 45 of file mrtk_nav.c.

Function Documentation

◆ apply_claslib_ppprtk_obsdef()

void apply_claslib_ppprtk_obsdef ( void )
extern

Apply the upstream claslib PPP-RTK observation slot layout.

Definition at line 635 of file mrtk_nav.c.

References MAXFREQ, set_obsdef(), SYS_GAL, SYS_GPS, and SYS_QZS.

Here is the call graph for this function:

◆ apply_pppsig()

void apply_pppsig ( const int * pppsig)
extern

Apply PPP signal selection options to obsdef tables.

Parameters
[in]pppsigSignal selection array [5]: GPS,QZS,GAL,BDS2,BDS3

Definition at line 539 of file mrtk_nav.c.

References MAXFREQ, set_obsdef(), SYS_BD2, SYS_CMP, SYS_GAL, SYS_GPS, and SYS_QZS.

Here is the call graph for this function:

◆ bds_gen()

int bds_gen ( int prn)
extern

BeiDou generation of a PRN.

Parameters
[in]prnBeiDou PRN
Returns
BDSGEN_2, BDSGEN_3, or 0 (invalid PRN)

Definition at line 273 of file mrtk_nav.c.

References bdsgen_, BDSGEN_3, MAXPRNCMP, MINPRNBDS3, and MINPRNCMP.

Referenced by is_bds2prn().

Here is the caller graph for this function:

◆ cmpeph()

int cmpeph ( const void * p1,
const void * p2 )
static

Definition at line 848 of file mrtk_nav.c.

References eph_t::sat, gtime_t::time, eph_t::toe, and eph_t::ttr.

Referenced by uniqeph().

Here is the caller graph for this function:

◆ cmpgeph()

int cmpgeph ( const void * p1,
const void * p2 )
static

Definition at line 888 of file mrtk_nav.c.

References geph_t::sat, gtime_t::time, geph_t::toe, and geph_t::tof.

Referenced by uniqgeph().

Here is the caller graph for this function:

◆ cmpseph()

int cmpseph ( const void * p1,
const void * p2 )
static

Definition at line 928 of file mrtk_nav.c.

References seph_t::sat, seph_t::t0, gtime_t::time, and seph_t::tof.

Referenced by uniqseph().

Here is the caller graph for this function:

◆ freenav()

void freenav ( nav_t * nav,
int opt )
extern

Free navigation data memory.

Parameters
[in,out]navNavigation data
[in]optOption (0x01:eph, 0x02:geph, 0x04:seph, 0x08:peph, 0x10:pclk, 0x20:alm, 0x40:tec)

Definition at line 1118 of file mrtk_nav.c.

References nav_s::alm, nav_s::eph, nav_s::eph_prev, free, nav_s::geph, nav_s::n, nav_s::na, nav_s::namax, nav_s::nc, nav_s::ncmax, nav_s::ne, nav_s::nemax, nav_s::ng, nav_s::ngmax, nav_s::nmax, nav_s::ns, nav_s::nsmax, nav_s::nt, nav_s::ntmax, nav_s::pclk, nav_s::peph, nav_s::pppiono, nav_s::seph, and nav_s::tec.

◆ freq_idx2ant_idx()

int freq_idx2ant_idx ( int sys,
int freq_idx )
extern

Convert frequency index to antenna PCV index.

Parameters
[in]sysSatellite system (SYS_???)
[in]freq_idxFrequency index (0,1,2,...)
Returns
Antenna PCV index (0..NFREQPCV-1) (NFREQPCV: error)

Definition at line 743 of file mrtk_nav.c.

References freq_idx2freq_num(), and freq_num2ant_idx().

Referenced by corr_meas(), and satantoff().

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

◆ freq_idx2freq_num()

int freq_idx2freq_num ( int sys,
int freq_idx )
extern

Convert frequency index to frequency number using obsdef table.

Parameters
[in]sysSatellite system (SYS_???)
[in]freq_idxFrequency index (0,1,2,...)
Returns
Frequency number (1,2,5,...) (0: error)

Definition at line 649 of file mrtk_nav.c.

References obsdef_t::freq_num, get_obsdef(), and MAXFREQ.

Referenced by ddres(), freq_idx2ant_idx(), get_wavelength(), sat_lambda(), satantoff(), and update_states().

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

◆ freq_num2ant_idx()

int freq_num2ant_idx ( int sys,
int freq_num )
extern

Convert frequency number to antenna PCV index.

Parameters
[in]sysSatellite system (SYS_???)
[in]freq_numFrequency number (1,2,5,...)
Returns
Antenna PCV index (0..NFREQPCV-1) (NFREQPCV: error)

Definition at line 710 of file mrtk_nav.c.

References NFREQPCV, SYS_BD2, SYS_CMP, SYS_GAL, SYS_GLO, SYS_GPS, SYS_QZS, and SYS_SBS.

Referenced by freq_idx2ant_idx(), and readantex().

Here is the caller graph for this function:

◆ freq_num2freq()

double freq_num2freq ( int sys,
int freq_num,
int fcn )
extern

Convert frequency number to frequency in Hz.

Parameters
[in]sysSatellite system (SYS_???)
[in]freq_numFrequency number (1,2,5,...)
[in]fcnGLONASS frequency channel number (-7..6)
Returns
Frequency (Hz) (0.0: error)

Definition at line 680 of file mrtk_nav.c.

References DFRQ1_GLO, DFRQ2_GLO, obsdef_t::freq_hz, get_obsdef(), MAXFREQ, and SYS_GLO.

Referenced by code2freq(), get_wavelength(), sat_lambda(), and satantoff().

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

◆ freq_num2freq_idx()

int freq_num2freq_idx ( int sys,
int freq_num )
extern

Convert frequency number to frequency index using obsdef table.

Parameters
[in]sysSatellite system (SYS_???)
[in]freq_numFrequency number (1,2,5,...)
Returns
Frequency index (0,1,2,...) (-1: error)

Definition at line 661 of file mrtk_nav.c.

References get_obsdef(), and MAXFREQ.

Referenced by code2freq_idx().

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

◆ get_obsdef()

obsdef_t * get_obsdef ( int sys)
static

Definition at line 401 of file mrtk_nav.c.

References obsdef_BD2, obsdef_BDS, obsdef_GAL, obsdef_GLO, obsdef_GPS, obsdef_IRN, obsdef_QZS, obsdef_SBS, SYS_BD2, SYS_CMP, SYS_GAL, SYS_GLO, SYS_GPS, SYS_IRN, SYS_QZS, and SYS_SBS.

Referenced by freq_idx2freq_num(), freq_num2freq(), freq_num2freq_idx(), and set_obsdef().

Here is the caller graph for this function:

◆ get_obsdef_default()

obsdef_t * get_obsdef_default ( int sys)
static

Definition at line 438 of file mrtk_nav.c.

References obsdef_BD2_def, obsdef_BDS_def, obsdef_GAL_def, obsdef_GLO_def, obsdef_GPS_def, obsdef_IRN_def, obsdef_QZS_def, obsdef_SBS_def, SYS_BD2, SYS_CMP, SYS_GAL, SYS_GLO, SYS_GPS, SYS_IRN, SYS_QZS, and SYS_SBS.

Referenced by set_obsdef().

Here is the caller graph for this function:

◆ is_bds2prn()

int is_bds2prn ( int prn)
extern

Test whether a BeiDou PRN is BDS-2 (see set_bds2prn()).

Parameters
[in]prnBeiDou PRN
Returns
1: BDS-2, 0: BDS-3 or out of range

Definition at line 249 of file mrtk_nav.c.

References bds_gen(), and BDSGEN_2.

Referenced by satno(), and satsys_bd2().

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

◆ is_bds3igso()

int is_bds3igso ( int prn)
extern

Test whether a BeiDou PRN is listed as BDS-3 IGSO (see set_bds3igso()).

Parameters
[in]prnBeiDou PRN
Returns
1: listed, 0: not listed or out of range

Definition at line 267 of file mrtk_nav.c.

References bds3igso_, MAXPRNCMP, and MINPRNCMP.

Referenced by is_bds3_igso().

Here is the caller graph for this function:

◆ parse_bdslist()

int parse_bdslist ( const char * str,
int maxprn,
uint8_t val,
uint8_t * list )
static

Definition at line 190 of file mrtk_nav.c.

Referenced by set_bds2prn(), and set_bds3igso().

Here is the caller graph for this function:

◆ readnav()

int readnav ( const char * file,
nav_t * nav )
extern

Read navigation data from file.

Parameters
[in]fileFile path
[out]navNavigation data
Returns
Status (1:ok, 0:no file)

Definition at line 985 of file mrtk_nav.c.

References eph_t::A, geph_t::acc, geph_t::age, eph_t::cic, eph_t::cis, eph_t::code, eph_t::crc, eph_t::crs, eph_t::cuc, eph_t::cus, eph_t::deln, geph_t::dtaun, eph_t::e, nav_s::eph, eph_t::f0, eph_t::f1, eph_t::f2, eph_t::fit, eph_t::flag, geph_t::frq, geph_t::gamn, nav_s::geph, eph_t::i0, eph_t::idot, eph_t::iodc, eph_t::iode, geph_t::iode, nav_s::ion_gps, eph_t::M0, eph_t::omg, eph_t::OMG0, eph_t::OMGd, geph_t::pos, eph_t::sat, geph_t::sat, satid2no(), satsys(), eph_t::sva, geph_t::sva, eph_t::svh, geph_t::svh, SYS_GLO, geph_t::taun, eph_t::tgd, gtime_t::time, eph_t::toc, eph_t::toe, geph_t::toe, eph_t::toes, geph_t::tof, trace(), eph_t::ttr, nav_s::utc_gps, and geph_t::vel.

Here is the call graph for this function:

◆ reset_obsdef()

void reset_obsdef ( void )
extern

Reset all obsdef tables to their pristine default frequency layout.

Note
#186: restores the full multi-band tables so a repeated/changed signal selection (e.g. an rtkrcv restart, or switching to correction=igs which skips apply_pppsig()) does not inherit a previously trimmed layout.

Definition at line 483 of file mrtk_nav.c.

References obsdef_BD2, obsdef_BD2_def, obsdef_BDS, obsdef_BDS_def, obsdef_GAL, obsdef_GAL_def, obsdef_GLO, obsdef_GLO_def, obsdef_GPS, obsdef_GPS_def, obsdef_IRN, obsdef_IRN_def, obsdef_QZS, obsdef_QZS_def, obsdef_SBS, obsdef_SBS_def, and save_obsdef_defaults().

Here is the call graph for this function:

◆ satexclude()

int satexclude ( int sat,
double var,
int svh,
const struct prcopt_t * opt )

Test excluded satellite.

Parameters
[in]satSatellite number
[in]varVariance of ephemeris (m^2)
[in]svhSV health flag (-1: correction not available)
[in]optProcessing options (NULL: not used)
Returns
Status (1:excluded, 0:not excluded)

Definition at line 1169 of file mrtk_nav.c.

References prcopt_t::exsats, MAX_VAR_EPH, prcopt_t::navsys, satsys(), SYS_CMP, SYS_GLO, SYS_QZS, and trace().

Referenced by ppp_res(), rescode(), zdres(), and zdres().

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

◆ satid2no()

int satid2no ( const char * id)
extern

Convert satellite id to satellite number.

Parameters
[in]idSatellite id (nn, Gnn, Rnn, Enn, Jnn, Cnn, Inn or Snn)
Returns
Satellite number (0: error)

Definition at line 753 of file mrtk_nav.c.

References MAXPRNGPS, MAXPRNQZS, MAXPRNSBS, MINPRNCMP, MINPRNGAL, MINPRNGLO, MINPRNGPS, MINPRNIRN, MINPRNLEO, MINPRNQZS, MINPRNSBS, satno(), SYS_CMP, SYS_GAL, SYS_GLO, SYS_GPS, SYS_IRN, SYS_LEO, SYS_QZS, and SYS_SBS.

Referenced by buff2sysopts(), decode_obsdata(), decode_obsepoch(), decode_solstat(), decode_stat(), input_statcorr(), readantex(), readbsnx(), readdcbf(), readfcbf(), readionexdcb(), readnav(), readrnxclk(), and readrnxnavb().

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

◆ satno()

int satno ( int sys,
int prn )
extern

Convert satellite system+prn/slot number to satellite number.

Parameters
[in]sysSatellite system (SYS_GPS, SYS_GLO, ...)
[in]prnSatellite prn/slot number
Returns
Satellite number (0: error)

Definition at line 58 of file mrtk_nav.c.

References is_bds2prn(), MAXPRNCMP, MAXPRNGAL, MAXPRNGLO, MAXPRNGPS, MAXPRNIRN, MAXPRNLEO, MAXPRNQZS, MAXPRNSBS, MINPRNBDS3, MINPRNCMP, MINPRNGAL, MINPRNGLO, MINPRNGPS, MINPRNIRN, MINPRNLEO, MINPRNQZS, MINPRNSBS, NSATCMP, NSATGAL, NSATGLO, NSATGPS, NSATIRN, NSATLEO, NSATQZS, SYS_BD2, SYS_CMP, SYS_GAL, SYS_GLO, SYS_GPS, SYS_IRN, SYS_LEO, SYS_QZS, and SYS_SBS.

Referenced by convsbs(), decode_alm_gps(), decode_alm_qzs(), decode_bdsephemerisb(), decode_bdsnav(), decode_bnx_01_01(), decode_bnx_01_02(), decode_bnx_01_03(), decode_bnx_01_04(), decode_bnx_01_05(), decode_bnx_01_06(), decode_bnx_01_07(), decode_bnx_01_14(), decode_bnx_7f_05(), decode_creseph(), decode_cresgloeph(), decode_cresgloraw(), decode_cresraw(), decode_cresraw2(), decode_eph(), decode_gal_fnav_eph(), decode_gal_inav_eph(), decode_galephemerisb(), decode_galinavephemerisb(), decode_galnav(), decode_gloephem(), decode_gloephemerisb(), decode_glonav(), decode_glostr_eph(), decode_gpsephemb(), decode_gpsnav(), decode_has_mask(), decode_lcliono(), decode_lD(), decode_miono_correction(), decode_navicephemerisb(), decode_nD(), decode_nd(), decode_NE(), decode_NN(), decode_qzsrawl6(), decode_qzssephemerisb(), decode_qzssrawephemb(), decode_qzssrawsubframeb(), decode_rangeb(), decode_rangecmpb(), decode_rawephemb(), decode_repb(), decode_rgeb(), decode_rged(), decode_rxmraw(), decode_rxmrawx(), decode_rxmsfrb(), decode_rxmsfrbx(), decode_sbstype1(), decode_sbstype9(), decode_SI(), decode_ss2eph(), decode_ss2meas(), decode_ssr1(), decode_ssr2(), decode_ssr3(), decode_ssr4(), decode_ssr5(), decode_ssr6(), decode_ssr7(), decode_stat(), decode_stqbds(), decode_stqglo(), decode_stqgloe(), decode_stqgps(), decode_stqraw(), decode_stqrawx(), decode_trkd5(), decode_trkmeas(), decode_trksfrbx(), decode_type1(), decode_type1002(), decode_type1004(), decode_type1010(), decode_type1012(), decode_type1019(), decode_type1020(), decode_type1041(), decode_type1042(), decode_type1044(), decode_type1045(), decode_type1046(), decode_type17(), decode_type18(), decode_type19(), decode_WE(), decode_xf5raw(), decode_xf7eph(), DecodeBeidouEphemeris(), DecodeGalileoEphemeris(), DecodeGPSEphemeris(), DecodeQZSSEphemeris(), DecodeType17(), encode_lcliono(), nextsat(), outrnx_glo_fcn(), readrnxnavb(), readsp3b(), readsp3h(), satid2no(), save_msm_obs(), svid2sat(), svmask2list(), svmask2nsatlist(), svmask2sat(), tle_pos(), and update_glofcn().

Here is the call graph for this function:

◆ satno2id()

void satno2id ( int sat,
char * id )
extern

Convert satellite number to satellite id.

Parameters
[in]satSatellite number
[out]idSatellite id (Gnn, Rnn, Enn, Jnn, Cnn, Inn or nnn)

Definition at line 817 of file mrtk_nav.c.

References MINPRNCMP, MINPRNGAL, MINPRNGLO, MINPRNGPS, MINPRNIRN, MINPRNLEO, MINPRNQZS, satsys(), SYS_CMP, SYS_GAL, SYS_GLO, SYS_GPS, SYS_IRN, SYS_LEO, SYS_QZS, and SYS_SBS.

Referenced by const_iono_corr(), corr_meas(), decode_has_mask(), decode_mcssr_cb(), decode_mcssr_cc(), decode_mcssr_oc(), decode_mcssr_pb(), decode_mcssr_ura(), decode_miono_correction(), detslp_gf(), detslp_ll(), detslp_mw(), detslp_ssr(), dump_halfc(), exc_sat_par(), gen_sat_sd(), gen_sd_matrix_n1(), getsysno(), outbsnxsol(), outsolstat(), ppp_res(), pppoutstat(), ppprtk_outstat(), raim_fde(), rtkoutstat(), savenav(), search_amb_ewl(), search_amb_lambda(), search_amb_wl(), setpcv(), sysopts2buff(), tracegnav(), tracehnav(), tracenav(), traceobs(), tracepclk(), tracepeph(), udiono_ppp(), and write_trace_amb().

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

◆ satsys()

int satsys ( int sat,
int * prn )
extern

Convert satellite number to satellite system.

Parameters
[in]satSatellite number (1-MAXSAT)
[in,out]prnSatellite prn/slot number (NULL: no output)
Returns
Satellite system (SYS_GPS, SYS_GLO, ...)

Definition at line 117 of file mrtk_nav.c.

References MAXSAT, MINPRNCMP, MINPRNGAL, MINPRNGLO, MINPRNGPS, MINPRNIRN, MINPRNLEO, MINPRNQZS, MINPRNSBS, NSATCMP, NSATGAL, NSATGLO, NSATGPS, NSATIRN, NSATLEO, NSATQZS, NSATSBS, SYS_CMP, SYS_GAL, SYS_GLO, SYS_GPS, SYS_IRN, SYS_LEO, SYS_NONE, SYS_QZS, and SYS_SBS.

Referenced by alm2pos(), avepos(), check_bit_width_combo(), check_bit_width_oc(), clas_osr_adjust_r_dts(), clas_osr_corrmeas(), clas_osr_selfreqpair(), clas_osr_zdres(), clas_ssr2osr(), const_iono_corr(), convnav(), corr_meas(), ddidx(), decode_alm1(), decode_alm2(), decode_bdsraw(), decode_bnx_7f_05_obs(), decode_cnav(), decode_cssr_combo(), decode_cssr_oc(), decode_Dx(), decode_eph(), decode_eph_bds_cnav(), decode_eph_cnav(), decode_Ex(), decode_Fx(), decode_galrawfnav(), decode_galrawinav(), decode_georawl1(), decode_geph(), decode_glorawca(), decode_gnav(), decode_ionutc(), decode_ionutc(), decode_L1ionutc(), decode_L1nav(), decode_measepoch(), decode_navicraw(), decode_obsdata(), decode_Px(), decode_px(), decode_rawca(), decode_Rx(), decode_rx(), decode_seph(), decode_track_stat(), decode_xd(), decode_xE(), decode_xP(), decode_xp(), decode_xR(), decode_xr(), detslp_ssr(), encode_lcliono(), encode_ssr1(), encode_ssr2(), encode_ssr3(), encode_ssr4(), encode_ssr5(), encode_ssr6(), encode_ssr7(), encode_type1001(), encode_type1002(), encode_type1003(), encode_type1004(), encode_type1005(), encode_type1006(), encode_type1009(), encode_type1010(), encode_type1011(), encode_type1012(), encode_type1019(), encode_type1020(), encode_type1041(), encode_type1042(), encode_type1044(), encode_type1045(), encode_type1046(), encode_type63(), eph2pos(), ephclk(), ephpos(), exc_sat_sd(), fcn_glo(), flushobuf(), gettgd(), iflc_freq2_idx(), input_rnxctr(), nextsat(), obs_code_for_freq(), obs_code_for_freq_vrs(), outnmea_gsa(), outnmea_gsv(), outrnxgnavb(), outrnxhnavb(), outrnxnavb(), outrnxobsb(), ppp_res(), ppp_rtk_pos(), prange(), procpos(), raw2rtcm(), readantex(), readbnxfp(), readfcbf(), readnav(), readrnxclk(), readrnxnavb(), relpos(), relposvrs(), rtcm2rtcm(), sat2code(), sat_lambda(), satexclude(), satno2id(), satpos_ssr(), satsys_bd2(), sbslongcorr(), scan_file(), seleph(), selfreqpair(), setpcv(), sig2idx(), sigmask2sig(), sigmask2sig_p(), to_satid(), udsatcb(), udsatpb(), update_eph(), update_obs(), update_ssr(), write_rtcm3_msm(), and zdres_sat().

◆ satsys_bd2()

int satsys_bd2 ( int sat,
int * prn )
extern

Distinguish BDS-2 from BDS-3.

Parameters
[in]satSatellite number
[out]prnPRN number (NULL: not output)
Returns
Satellite system (SYS_CMP for BDS-3, SYS_BD2 for BDS-2)

Definition at line 159 of file mrtk_nav.c.

References is_bds2prn(), satsys(), SYS_BD2, SYS_CMP, and SYS_NONE.

Referenced by corr_meas(), decode_obsdata(), exc_sat_par(), exc_sat_sd(), get_wavelength(), is_bds3_igso(), mcssr_sigcode(), ppp_res(), rescode(), sat2freq(), satantoff(), and update_states().

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

◆ save_obsdef_defaults()

void save_obsdef_defaults ( void )
static

Definition at line 462 of file mrtk_nav.c.

References obsdef_BD2, obsdef_BD2_def, obsdef_BDS, obsdef_BDS_def, obsdef_defaults_saved, obsdef_GAL, obsdef_GAL_def, obsdef_GLO, obsdef_GLO_def, obsdef_GPS, obsdef_GPS_def, obsdef_IRN, obsdef_IRN_def, obsdef_QZS, obsdef_QZS_def, obsdef_SBS, and obsdef_SBS_def.

Referenced by reset_obsdef(), and set_obsdef().

Here is the caller graph for this function:

◆ savenav()

int savenav ( const char * file,
const nav_t * nav )
extern

Save navigation data to file.

Parameters
[in]fileFile path
[in]navNavigation data
Returns
Status (1:ok, 0:file open error)

Definition at line 1058 of file mrtk_nav.c.

References eph_t::A, geph_t::acc, geph_t::age, eph_t::cic, eph_t::cis, eph_t::code, eph_t::crc, eph_t::crs, eph_t::cuc, eph_t::cus, eph_t::deln, geph_t::dtaun, eph_t::e, nav_s::eph, eph_t::f0, eph_t::f1, eph_t::f2, eph_t::fit, eph_t::flag, geph_t::frq, geph_t::gamn, nav_s::geph, eph_t::i0, eph_t::idot, eph_t::iodc, eph_t::iode, geph_t::iode, nav_s::ion_gps, eph_t::M0, MAXPRNGLO, MAXSAT, eph_t::omg, eph_t::OMG0, eph_t::OMGd, geph_t::pos, eph_t::sat, geph_t::sat, satno2id(), eph_t::sva, geph_t::sva, eph_t::svh, geph_t::svh, geph_t::taun, eph_t::tgd, gtime_t::time, eph_t::toc, eph_t::toe, geph_t::toe, eph_t::toes, geph_t::tof, trace(), eph_t::ttr, nav_s::utc_gps, and geph_t::vel.

Here is the call graph for this function:

◆ set_bds2prn()

int set_bds2prn ( const char * str)
extern

Set the BDS-2 satellites in BeiDou PRN 1-18.

Since the BeiDou PRN reassignment (2026-04-10 to 04-21) BDS-3 satellites are also on PRN 1-18. A PRN 1-18 is BDS-2 only when listed here; PRN >= 19 is always BDS-3. The setting is process-global and affects satsys_bd2(), satno(SYS_BD2, prn) and all their callers, including RINEX reading.

Parameters
[in]strSatellite list, e.g. "C09,C10" or "C01-C18" ("" or NULL: no BDS-2)
Returns
Number of satellites set (-1: invalid list; no BDS-2 is set)

Definition at line 231 of file mrtk_nav.c.

References bdsgen_, BDSGEN_2, BDSGEN_3, MAXPRNCMP, MINPRNBDS3, MINPRNCMP, NBDSTBL, and parse_bdslist().

Referenced by set_bdsopt().

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

◆ set_bds3igso()

int set_bds3igso ( const char * str)
extern

Set the BDS-3 IGSO satellites (excluded as PPP-AR reference satellite).

Parameters
[in]strSatellite list, e.g. "C06-C08" or "C38,C39,C40" ("" or NULL: C06-C08)
Returns
Number of satellites set (-1: invalid list; the default C06-C08 is set)

Definition at line 251 of file mrtk_nav.c.

References bds3igso_, MAXPRNCMP, NBDSTBL, and parse_bdslist().

Referenced by set_bdsopt().

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

◆ set_bdsopt()

int set_bdsopt ( const prcopt_t * opt,
int warn )
extern

Apply the BeiDou PRN-reassignment options process-wide.

Calls set_bds2prn(opt->bds2prn) and set_bds3igso(opt->bds3igso). With warn, also prints to stderr when a list is invalid, or when BeiDou is enabled (opt->navsys) but bds2prn was not given by the configuration (opt->bds2prn_set).

Parameters
[in]optProcessing options
[in]warnPrint warnings to stderr (0: trace only)
Returns
1: ok, 0: an invalid list was replaced by its default

Definition at line 282 of file mrtk_nav.c.

References prcopt_t::bds2prn, prcopt_t::bds2prn_set, prcopt_t::bds3igso, prcopt_t::navsys, set_bds2prn(), set_bds3igso(), SYS_CMP, and trace().

Referenced by postpos(), and rtkinit().

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

◆ set_obsdef()

void set_obsdef ( int sys,
const int * freq_nums )
extern

Rearrange obsdef table for a satellite system by frequency numbers.

Parameters
[in]sysSatellite system (SYS_???)
[in]freq_numsArray of frequency numbers [MAXFREQ] (0=unused)

Definition at line 502 of file mrtk_nav.c.

References obsdef_t::freq_hz, obsdef_t::freq_num, get_obsdef(), get_obsdef_default(), MAXFREQ, and save_obsdef_defaults().

Referenced by apply_claslib_ppprtk_obsdef(), apply_pppsig(), and mrtk_sigcfg_to_obsdef().

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

◆ uniqeph()

void uniqeph ( nav_t * nav)
static

Definition at line 855 of file mrtk_nav.c.

References cmpeph(), nav_s::eph, free, eph_t::iode, nav_s::n, nav_s::nmax, eph_t::sat, trace(), and eph_t::type.

Referenced by uniqnav().

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

◆ uniqgeph()

void uniqgeph ( nav_t * nav)
static

Definition at line 895 of file mrtk_nav.c.

References cmpgeph(), free, nav_s::geph, nav_s::ng, nav_s::ngmax, geph_t::sat, geph_t::svh, gtime_t::time, geph_t::toe, and trace().

Referenced by uniqnav().

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

◆ uniqnav()

void uniqnav ( nav_t * nav)
extern

Unique ephemerides in navigation data.

Parameters
[in,out]navNavigation data

Definition at line 971 of file mrtk_nav.c.

References nav_s::n, nav_s::ng, nav_s::ns, trace(), uniqeph(), uniqgeph(), and uniqseph().

Referenced by readobsnav().

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

◆ uniqseph()

void uniqseph ( nav_t * nav)
static

Definition at line 935 of file mrtk_nav.c.

References cmpseph(), free, nav_s::ns, nav_s::nsmax, seph_t::sat, nav_s::seph, seph_t::t0, gtime_t::time, and trace().

Referenced by uniqnav().

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

Variable Documentation

◆ bds3igso_

uint8_t bds3igso_[(MAXPRNCMP< 63 ? 64 :MAXPRNCMP+1)] = {0, 0, 0, 0, 0, 0, 1, 1, 1}
static

Definition at line 185 of file mrtk_nav.c.

Referenced by is_bds3igso(), and set_bds3igso().

◆ bdsgen_

uint8_t bdsgen_[(MAXPRNCMP< 63 ? 64 :MAXPRNCMP+1)] = {0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3}
static

Definition at line 181 of file mrtk_nav.c.

Referenced by bds_gen(), and set_bds2prn().

◆ obsdef_BD2

obsdef_t obsdef_BD2[MAXFREQ]
static
Initial value:
= {
{2, FREQ1_CMP},
{6, FREQ3_CMP},
{7, FREQ2_CMP},
{0, 0.0},
{0, 0.0},
{0, 0.0},
{0, 0.0},
}
#define FREQ2_CMP
Definition mrtk_obs.c:82
#define FREQ3_CMP
Definition mrtk_obs.c:83
#define FREQ1_CMP
Definition mrtk_obs.c:81

Definition at line 380 of file mrtk_nav.c.

Referenced by get_obsdef(), reset_obsdef(), and save_obsdef_defaults().

◆ obsdef_BD2_def

obsdef_t obsdef_BD2_def[MAXFREQ]
static

Definition at line 434 of file mrtk_nav.c.

Referenced by get_obsdef_default(), reset_obsdef(), and save_obsdef_defaults().

◆ obsdef_BDS

obsdef_t obsdef_BDS[MAXFREQ]
static
Initial value:
= {
{2, FREQ1_CMP},
{6, FREQ3_CMP},
{7, FREQ2_CMP},
{1, FREQ1},
{5, FREQ5},
{8, FREQ8},
{0, 0.0},
}
#define FREQ5
Definition mrtk_obs.c:69
#define FREQ8
Definition mrtk_obs.c:72
#define FREQ1
Definition mrtk_obs.c:67

Definition at line 370 of file mrtk_nav.c.

Referenced by get_obsdef(), reset_obsdef(), and save_obsdef_defaults().

◆ obsdef_BDS_def

obsdef_t obsdef_BDS_def[MAXFREQ]
static

Definition at line 434 of file mrtk_nav.c.

Referenced by get_obsdef_default(), reset_obsdef(), and save_obsdef_defaults().

◆ obsdef_defaults_saved

int obsdef_defaults_saved = 0
static

Definition at line 435 of file mrtk_nav.c.

Referenced by save_obsdef_defaults().

◆ obsdef_GAL

obsdef_t obsdef_GAL[MAXFREQ]
static
Initial value:
= {
{1, FREQ1},
{5, FREQ5},
{7, FREQ7},
{6, FREQ6},
{8, FREQ8},
{0, 0.0},
{0, 0.0},
}
#define FREQ6
Definition mrtk_obs.c:70
#define FREQ7
Definition mrtk_obs.c:71

Definition at line 340 of file mrtk_nav.c.

Referenced by get_obsdef(), reset_obsdef(), and save_obsdef_defaults().

◆ obsdef_GAL_def

obsdef_t obsdef_GAL_def[MAXFREQ]
static

Definition at line 433 of file mrtk_nav.c.

Referenced by get_obsdef_default(), reset_obsdef(), and save_obsdef_defaults().

◆ obsdef_GLO

obsdef_t obsdef_GLO[MAXFREQ]
static
Initial value:
= {
{1, FREQ1_GLO},
{2, FREQ2_GLO},
{0, 0.0},
{0, 0.0},
{0, 0.0},
{0, 0.0},
{0, 0.0},
}
#define FREQ2_GLO
Definition mrtk_obs.c:76
#define FREQ1_GLO
Definition mrtk_obs.c:74

Definition at line 330 of file mrtk_nav.c.

Referenced by get_obsdef(), reset_obsdef(), and save_obsdef_defaults().

◆ obsdef_GLO_def

obsdef_t obsdef_GLO_def[MAXFREQ]
static

Definition at line 433 of file mrtk_nav.c.

Referenced by get_obsdef_default(), reset_obsdef(), and save_obsdef_defaults().

◆ obsdef_GPS

obsdef_t obsdef_GPS[MAXFREQ]
static
Initial value:
= {
{1, FREQ1},
{2, FREQ2},
{5, FREQ5},
{0, 0.0},
{0, 0.0},
{0, 0.0},
{0, 0.0},
}
#define FREQ2
Definition mrtk_obs.c:68

Definition at line 320 of file mrtk_nav.c.

Referenced by get_obsdef(), reset_obsdef(), and save_obsdef_defaults().

◆ obsdef_GPS_def

obsdef_t obsdef_GPS_def[MAXFREQ]
static

Definition at line 433 of file mrtk_nav.c.

Referenced by get_obsdef_default(), reset_obsdef(), and save_obsdef_defaults().

◆ obsdef_IRN

obsdef_t obsdef_IRN[MAXFREQ]
static
Initial value:
= {
{5, FREQ5},
{9, FREQ9},
{0, 0.0},
{0, 0.0},
{0, 0.0},
{0, 0.0},
{0, 0.0},
}
#define FREQ9
Definition mrtk_obs.c:73

Definition at line 390 of file mrtk_nav.c.

Referenced by get_obsdef(), reset_obsdef(), and save_obsdef_defaults().

◆ obsdef_IRN_def

obsdef_t obsdef_IRN_def[MAXFREQ]
static

Definition at line 434 of file mrtk_nav.c.

Referenced by get_obsdef_default(), reset_obsdef(), and save_obsdef_defaults().

◆ obsdef_QZS

obsdef_t obsdef_QZS[MAXFREQ]
static
Initial value:
= {
{1, FREQ1},
{5, FREQ5},
{2, FREQ2},
{6, FREQ6},
{0, 0.0},
{0, 0.0},
{0, 0.0},
}

Definition at line 350 of file mrtk_nav.c.

Referenced by get_obsdef(), reset_obsdef(), and save_obsdef_defaults().

◆ obsdef_QZS_def

obsdef_t obsdef_QZS_def[MAXFREQ]
static

Definition at line 433 of file mrtk_nav.c.

Referenced by get_obsdef_default(), reset_obsdef(), and save_obsdef_defaults().

◆ obsdef_SBS

obsdef_t obsdef_SBS[MAXFREQ]
static
Initial value:
= {
{1, FREQ1},
{5, FREQ5},
{0, 0.0},
{0, 0.0},
{0, 0.0},
{0, 0.0},
{0, 0.0},
}

Definition at line 360 of file mrtk_nav.c.

Referenced by get_obsdef(), reset_obsdef(), and save_obsdef_defaults().

◆ obsdef_SBS_def

obsdef_t obsdef_SBS_def[MAXFREQ]
static

Definition at line 434 of file mrtk_nav.c.

Referenced by get_obsdef_default(), reset_obsdef(), and save_obsdef_defaults().