MRTKLIB 0.7.14
Modernized GNSS Positioning Library
Loading...
Searching...
No Matches
mrtk_bias_sinex.c File Reference
#include "mrtklib/mrtk_bias_sinex.h"
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "mrtklib/mrtk_sys.h"
#include "mrtklib/mrtk_trace.h"
Include dependency graph for mrtk_bias_sinex.c:

Go to the source code of this file.

Macros

#define NS2M   (CLIGHT / 1E9)
#define M2NS   (1E9 / CLIGHT)

Functions

void satno2id (int sat, char *id)
int satid2no (const char *id)
uint8_t obs2code (const char *obs)
char * code2obs (uint8_t code)
char * time_str (gtime_t t, int n)
int getsysno (int sat)
 Get system code number based on satellite number.
biass_t * getbiass (void)
 Get pointer to the bias structure.
static void freebia (bia_t **ary, int *n, int *nmax)
static void freebiass (void)
void addbia (const bia_t *bia, bia_t **ary, int *n, int *nmax)
 Add a bias entry to the bias array.
int readbsnx (const char *file)
 Read BIAS-SINEX file.
static void time2biast (gtime_t time, double *year, double *doy, double *tod)
static char * code2sigs (uint8_t code, int cpflag)
void outbsnxh (FILE *fp, gtime_t ts, gtime_t te, const char *agency)
 Output BIAS-SINEX file header.
void outbsnxrefh (FILE *fp)
 Output FILE/REFERENCE header.
void outbsnxrefb (FILE *fp, int type, char *reftext)
 Output FILE/REFERENCE body line.
void outbsnxreff (FILE *fp)
 Output FILE/REFERENCE footer.
void outbsnxcomh (FILE *fp)
 Output FILE/COMMENT header.
void outbsnxcomb (FILE *fp, char *comtext)
 Output FILE/COMMENT body line.
void outbsnxcomf (FILE *fp)
 Output FILE/COMMENT footer.
static void outbsnxsold (FILE *fp, int cpflag, int n, const bia_t *biad, char *sat, char *sta)
void outbsnxsol (FILE *fp)
 Output BIAS/SOLUTION section.
int udosb_sat (osb_t *osb, gtime_t gt, int mode)
 Update satellite OSB structure with current biases.
int udosb_station (osb_t *osb, gtime_t gt, int mode, char *name)
 Update station OSB structure with current biases.

Variables

static const double CLIGHT = 299792458.0
static biass_t biass = {0}
static char syscode [] = "GREJCIS"
static char typeid [][5] = {"DSB ", "ISB ", "OSB "}

Macro Definition Documentation

◆ M2NS

#define M2NS   (1E9 / CLIGHT)

Definition at line 29 of file mrtk_bias_sinex.c.

Referenced by outbsnxsold().

◆ NS2M

#define NS2M   (CLIGHT / 1E9)

Definition at line 28 of file mrtk_bias_sinex.c.

Referenced by readbsnx().

Function Documentation

◆ addbia()

void addbia ( const bia_t * bia,
bia_t ** ary,
int * n,
int * nmax )

Add a bias entry to the bias array.

Parameters
[in]biaBias entry to add
[out]aryPointer to bias array
[out]nCurrent number of entries in array
[out]nmaxCurrent maximum number of entries in array

Definition at line 111 of file mrtk_bias_sinex.c.

References free, and trace().

Referenced by readbsnx(), and readfcbf().

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

◆ code2obs()

char * code2obs ( uint8_t code)
extern

Definition at line 190 of file mrtk_obs.c.

References CODE_NONE, MAXCODE, and obscodes.

Referenced by code2sigs(), corr_meas(), decode_mcssr_cb(), detslp_code(), obsindex(), sat_lambda(), scan_file(), set_index(), setopt_obstype(), and to_sigid().

Here is the caller graph for this function:

◆ code2sigs()

char * code2sigs ( uint8_t code,
int cpflag )
static

Definition at line 302 of file mrtk_bias_sinex.c.

References code2obs(), CODE_NONE, and MAXCODE.

Referenced by outbsnxsold().

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

◆ freebia()

void freebia ( bia_t ** ary,
int * n,
int * nmax )
static

Definition at line 68 of file mrtk_bias_sinex.c.

References free.

Referenced by freebiass().

Here is the caller graph for this function:

◆ freebiass()

void freebiass ( void )
static

Definition at line 77 of file mrtk_bias_sinex.c.

References biass, freebia(), MAXBSNXSYS, MAXSAT, and MAXSTA.

Referenced by readbsnx().

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

◆ getbiass()

biass_t * getbiass ( void )

Get pointer to the bias structure.

Returns
Pointer to bias structure

Definition at line 65 of file mrtk_bias_sinex.c.

References biass.

Referenced by outbsnxsol(), udosb_sat(), and udosb_station().

Here is the caller graph for this function:

◆ getsysno()

int getsysno ( int sat)

Get system code number based on satellite number.

Parameters
[in]satSatellite number
Returns
System code number (0 or positive: valid, -1: error)

Definition at line 47 of file mrtk_bias_sinex.c.

References MAXBSNXSYS, satno2id(), and syscode.

Referenced by corr_meas().

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

◆ obs2code()

uint8_t obs2code ( const char * obs)
extern

Definition at line 173 of file mrtk_obs.c.

References CODE_NONE, and obscodes.

Referenced by outrnx_phase_shift(), readbsnx(), save_msm_obs(), set_index(), and setopt_phshift().

Here is the caller graph for this function:

◆ outbsnxcomb()

void outbsnxcomb ( FILE * fp,
char * comtext )

Output FILE/COMMENT body line.

Parameters
[in]fpOutput file pointer
[in]comtextComment text to output

Definition at line 418 of file mrtk_bias_sinex.c.

References trace().

Here is the call graph for this function:

◆ outbsnxcomf()

void outbsnxcomf ( FILE * fp)

Output FILE/COMMENT footer.

Parameters
[in]fpOutput file pointer

Definition at line 435 of file mrtk_bias_sinex.c.

References trace().

Here is the call graph for this function:

◆ outbsnxcomh()

void outbsnxcomh ( FILE * fp)

Output FILE/COMMENT header.

Parameters
[in]fpOutput file pointer

Definition at line 403 of file mrtk_bias_sinex.c.

References trace().

Here is the call graph for this function:

◆ outbsnxh()

void outbsnxh ( FILE * fp,
gtime_t ts,
gtime_t te,
const char * agency )

Output BIAS-SINEX file header.

Parameters
[in]fpOutput file pointer
[in]tsStart time
[in]teEnd time
[in]agencyAgency name

Definition at line 326 of file mrtk_bias_sinex.c.

References time2biast(), time2epoch(), timeget(), and trace().

Here is the call graph for this function:

◆ outbsnxrefb()

void outbsnxrefb ( FILE * fp,
int type,
char * reftext )

Output FILE/REFERENCE body line.

Parameters
[in]fpOutput file pointer
[in]typeType of information
[in]reftextReference text to output

Definition at line 368 of file mrtk_bias_sinex.c.

References trace().

Here is the call graph for this function:

◆ outbsnxreff()

void outbsnxreff ( FILE * fp)

Output FILE/REFERENCE footer.

Parameters
[in]fpOutput file pointer

Definition at line 390 of file mrtk_bias_sinex.c.

References trace().

Here is the call graph for this function:

◆ outbsnxrefh()

void outbsnxrefh ( FILE * fp)

Output FILE/REFERENCE header.

Parameters
[in]fpOutput file pointer

Definition at line 350 of file mrtk_bias_sinex.c.

References trace().

Here is the call graph for this function:

◆ outbsnxsol()

void outbsnxsol ( FILE * fp)

Output BIAS/SOLUTION section.

Parameters
[in]fpOutput file pointer

Definition at line 471 of file mrtk_bias_sinex.c.

References biass, getbiass(), MAXBSNXSYS, MAXSAT, outbsnxsold(), satno2id(), syscode, and trace().

Here is the call graph for this function:

◆ outbsnxsold()

void outbsnxsold ( FILE * fp,
int cpflag,
int n,
const bia_t * biad,
char * sat,
char * sta )
static

Definition at line 444 of file mrtk_bias_sinex.c.

References code2sigs(), M2NS, and time2biast().

Referenced by outbsnxsol().

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

◆ readbsnx()

int readbsnx ( const char * file)

Read BIAS-SINEX file.

Parameters
[in]fileSINEX file path
Returns
Number of biases read (0: error)

Definition at line 134 of file mrtk_bias_sinex.c.

References addbia(), biass, bia_t::code, CODE_NONE, epoch2time(), freebiass(), MAXBSNXSYS, MAXSTA, NS2M, obs2code(), satid2no(), bia_t::slp, bia_t::slpstd, str2num(), syscode, bia_t::t0, bia_t::t1, time_str(), timeadd(), timediff(), trace(), bia_t::type, bia_t::val, and bia_t::valstd.

Referenced by udbiass().

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

◆ satid2no()

int satid2no ( const char * id)
extern

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(), readbsnx(), readdcbf(), readionexdcb(), readrnxclk(), and readrnxnavb().

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

◆ satno2id()

void satno2id ( int sat,
char * id )
extern

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 dump_halfc(), getsysno(), outbsnxsol(), outsolstat(), ppprtk_outstat(), raim_fde(), rtkoutstat(), setpcv(), sysopts2buff(), tracegnav(), tracehnav(), tracenav(), traceobs(), tracepclk(), and tracepeph().

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

◆ time2biast()

void time2biast ( gtime_t time,
double * year,
double * doy,
double * tod )
static

Definition at line 287 of file mrtk_bias_sinex.c.

References epoch2time(), time2epoch(), and timediff().

Referenced by outbsnxh(), and outbsnxsold().

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

◆ time_str()

char * time_str ( gtime_t t,
int n )
extern

Definition at line 530 of file mrtk_time.c.

◆ udosb_sat()

int udosb_sat ( osb_t * osb,
gtime_t gt,
int mode )

Update satellite OSB structure with current biases.

Parameters
[out]osbOSB structure to update
[in]gtCurrent time
[in]modeMode (0: current, 1: all)
Returns
Number of updated biases

Definition at line 528 of file mrtk_bias_sinex.c.

References biass, bia_t::code, CODE_NONE, getbiass(), osb_t::gt, MAXCODE, MAXSAT, osb_t::scb, osb_t::spb, bia_t::t0, bia_t::t1, timediff(), bia_t::val, osb_t::vscb, and osb_t::vspb.

Referenced by udbiass().

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

◆ udosb_station()

int udosb_station ( osb_t * osb,
gtime_t gt,
int mode,
char * name )

Update station OSB structure with current biases.

Parameters
[out]osbOSB structure to update
[in]gtCurrent time
[in]modeMode (0: current, 1: all)
[in]nameStation name
Returns
Number of updated biases

Definition at line 578 of file mrtk_bias_sinex.c.

References biass, bia_t::code, CODE_NONE, getbiass(), osb_t::gt, MAXBSNXSYS, MAXCODE, MAXSAT, osb_t::rsatcb, osb_t::rsyscb, osb_t::staname, bia_t::t0, bia_t::t1, timediff(), bia_t::val, osb_t::vrsatcb, and osb_t::vrsyscb.

Referenced by udbiass().

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

Variable Documentation

◆ biass

biass_t biass = {0}
static

Definition at line 38 of file mrtk_bias_sinex.c.

Referenced by freebiass(), getbiass(), outbsnxsol(), readbsnx(), udosb_sat(), and udosb_station().

◆ CLIGHT

const double CLIGHT = 299792458.0
static

Definition at line 27 of file mrtk_bias_sinex.c.

◆ syscode

char syscode[] = "GREJCIS"
static

Definition at line 39 of file mrtk_bias_sinex.c.

Referenced by getsysno(), outbsnxsol(), and readbsnx().

◆ typeid

char typeid[][5] = {"DSB ", "ISB ", "OSB "}
static

Definition at line 40 of file mrtk_bias_sinex.c.