MRTKLIB 0.7.14
Modernized GNSS Positioning Library
Loading...
Searching...
No Matches
mrtk_rinex.h File Reference

MRTKLIB RINEX Module — RINEX file read/write types and functions. More...

#include <stdio.h>
#include "mrtklib/mrtk_eph.h"
#include "mrtklib/mrtk_foundation.h"
#include "mrtklib/mrtk_nav.h"
#include "mrtklib/mrtk_obs.h"
#include "mrtklib/mrtk_time.h"
Include dependency graph for mrtk_rinex.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  rnxopt_t
 RINEX options type. More...
struct  rnxctr_t
 RINEX control struct type. More...

Functions

int readrnx (const char *file, int rcv, const char *opt, obs_t *obs, nav_t *nav, sta_t *sta)
 Read RINEX OBS and NAV files.
int readrnxt (const char *file, int rcv, gtime_t ts, gtime_t te, double tint, const char *opt, obs_t *obs, nav_t *nav, sta_t *sta)
 Read RINEX OBS and NAV files with time span.
int readrnxc (const char *file, nav_t *nav)
 Read RINEX clock files.
int outrnxobsh (FILE *fp, const rnxopt_t *opt, const nav_t *nav)
 Output RINEX observation data file header.
int outrnxobsb (FILE *fp, const rnxopt_t *opt, const obsd_t *obs, int n, int flag)
 Output RINEX observation data body.
int outrnxnavh (FILE *fp, const rnxopt_t *opt, const nav_t *nav)
 Output RINEX navigation data file header.
int outrnxnavb (FILE *fp, const rnxopt_t *opt, const eph_t *eph)
 Output RINEX navigation data file body.
int outrnxgnavh (FILE *fp, const rnxopt_t *opt, const nav_t *nav)
 Output RINEX GLONASS navigation data file header.
int outrnxgnavb (FILE *fp, const rnxopt_t *opt, const geph_t *geph)
 Output RINEX GLONASS navigation data file body.
int outrnxhnavh (FILE *fp, const rnxopt_t *opt, const nav_t *nav)
 Output RINEX GEO navigation data file header.
int outrnxhnavb (FILE *fp, const rnxopt_t *opt, const seph_t *seph)
 Output RINEX GEO navigation data file body.
int outrnxlnavh (FILE *fp, const rnxopt_t *opt, const nav_t *nav)
 Output RINEX Galileo navigation data file header.
int outrnxqnavh (FILE *fp, const rnxopt_t *opt, const nav_t *nav)
 Output RINEX QZSS navigation data file header.
int outrnxcnavh (FILE *fp, const rnxopt_t *opt, const nav_t *nav)
 Output RINEX BDS navigation data file header.
int outrnxinavh (FILE *fp, const rnxopt_t *opt, const nav_t *nav)
 Output RINEX NavIC/IRNSS navigation data file header.
int init_rnxctr (rnxctr_t *rnx)
 Initialize RINEX control struct.
void free_rnxctr (rnxctr_t *rnx)
 Free RINEX control struct buffers.
int open_rnxctr (rnxctr_t *rnx, FILE *fp)
 Open RINEX data (read header).
int input_rnxctr (rnxctr_t *rnx, FILE *fp)
 Input RINEX control (read next message).

Detailed Description

MRTKLIB RINEX Module — RINEX file read/write types and functions.

This header provides the RINEX option type (rnxopt_t), RINEX control struct (rnxctr_t), and all public RINEX read/write function declarations extracted from rinex.c.

Note
All functions in this module are pure cut-and-paste extractions from rinex.c with zero algorithmic changes.

Definition in file mrtk_rinex.h.

Function Documentation

◆ free_rnxctr()

void free_rnxctr ( rnxctr_t * rnx)

Free RINEX control struct buffers.

Parameters
[in,out]rnxRINEX control struct

Definition at line 2522 of file mrtk_rinex.c.

References obs_t::data, nav_s::eph, free, nav_s::geph, nav_s::n, obs_t::n, rnxctr_t::nav, nav_s::ng, nav_s::ns, rnxctr_t::obs, nav_s::seph, and trace().

Referenced by free_strfile(), and init_rnxctr().

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

◆ init_rnxctr()

int init_rnxctr ( rnxctr_t * rnx)

Initialize RINEX control struct.

Parameters
[in,out]rnxRINEX control struct
Returns
Status (1:ok, 0:memory allocation error)

Definition at line 2466 of file mrtk_rinex.c.

References obs_t::data, nav_s::eph, rnxctr_t::ephsat, rnxctr_t::ephset, free_rnxctr(), nav_s::geph, malloc, MAXOBS, MAXOBSTYPE, MAXSAT, nav_s::n, obs_t::n, rnxctr_t::nav, nav_s::ng, nav_s::ns, NSATGLO, NSATSBS, rnxctr_t::obs, rnxctr_t::opt, nav_s::seph, rnxctr_t::sys, rnxctr_t::time, rnxctr_t::tobs, trace(), rnxctr_t::tsys, and rnxctr_t::ver.

Referenced by gen_strfile().

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

◆ input_rnxctr()

int input_rnxctr ( rnxctr_t * rnx,
FILE * fp )

Input RINEX control (read next message).

Parameters
[in,out]rnxRINEX control struct
[in]fpFile pointer
Returns
Status (-2:end of file, 0:no message, 1:obs data, 2:nav data)

Definition at line 2592 of file mrtk_rinex.c.

References eph_t::code, obs_t::data, nav_s::eph, rnxctr_t::ephsat, rnxctr_t::ephset, nav_s::geph, MAXSAT, MINPRNSBS, obs_t::n, rnxctr_t::nav, rnxctr_t::obs, rnxctr_t::opt, readrnxnavb(), readrnxobsb(), eph_t::sat, geph_t::sat, seph_t::sat, satsys(), nav_s::seph, rnxctr_t::sta, SYS_GAL, SYS_GLO, SYS_NONE, SYS_QZS, SYS_SBS, obsd_t::time, rnxctr_t::time, rnxctr_t::tobs, geph_t::tof, seph_t::tof, trace(), rnxctr_t::tsys, eph_t::ttr, rnxctr_t::type, and rnxctr_t::ver.

Referenced by input_strfile().

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

◆ open_rnxctr()

int open_rnxctr ( rnxctr_t * rnx,
FILE * fp )

Open RINEX data (read header).

Parameters
[in,out]rnxRINEX control struct
[in]fpFile pointer
Returns
Status (-2:end of file, 0:no message, 1:ok)

Definition at line 2545 of file mrtk_rinex.c.

References rnxctr_t::ephsat, rnxctr_t::ephset, MAXOBSTYPE, rnxctr_t::nav, NUMSYS, readrnxh(), rnxctr_t::sta, rnxctr_t::sys, rnxctr_t::tobs, trace(), rnxctr_t::tsys, rnxctr_t::type, and rnxctr_t::ver.

Referenced by open_strfile().

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

◆ outrnxcnavh()

int outrnxcnavh ( FILE * fp,
const rnxopt_t * opt,
const nav_t * nav )

Output RINEX BDS navigation data file header.

Parameters
[in]fpOutput file pointer
[in]optRINEX options
[in]navNavigation data (NULL: no input)
Returns
Status (1:ok, 0:output error)

Definition at line 3697 of file mrtk_rinex.c.

References rnxopt_t::comment, MAXCOMMENT, out_iono(), out_leaps(), out_time(), rnxopt_t::prog, rnxopt_t::rnxver, rnxopt_t::runby, SYS_CMP, timestr_rnx(), and trace().

Referenced by write_header().

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

◆ outrnxgnavb()

int outrnxgnavb ( FILE * fp,
const rnxopt_t * opt,
const geph_t * geph )

Output RINEX GLONASS navigation data file body.

Parameters
[in]fpOutput file pointer
[in]optRINEX options
[in]gephGLONASS ephemeris
Returns
Status (1:ok, 0:output error)

Definition at line 3466 of file mrtk_rinex.c.

References geph_t::acc, geph_t::age, geph_t::dtaun, geph_t::flags, geph_t::frq, geph_t::gamn, gpst2utc(), rnxopt_t::navsys, outnavf(), geph_t::pos, rnxopt_t::rnxver, geph_t::sat, sat2code(), satsys(), geph_t::sva, geph_t::svh, SYS_GLO, geph_t::taun, time2epoch(), time2gpst(), geph_t::toe, geph_t::tof, trace(), and geph_t::vel.

Referenced by convnav().

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

◆ outrnxgnavh()

int outrnxgnavh ( FILE * fp,
const rnxopt_t * opt,
const nav_t * nav )

Output RINEX GLONASS navigation data file header.

Parameters
[in]fpOutput file pointer
[in]optRINEX options
[in]navNavigation data (NULL: no input)
Returns
Status (1:ok, 0:output error)

Definition at line 3431 of file mrtk_rinex.c.

References rnxopt_t::comment, MAXCOMMENT, out_leaps(), out_time(), rnxopt_t::prog, rnxopt_t::rnxver, rnxopt_t::runby, SYS_GLO, SYS_GPS, timestr_rnx(), and trace().

Referenced by write_header().

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

◆ outrnxhnavb()

int outrnxhnavb ( FILE * fp,
const rnxopt_t * opt,
const seph_t * seph )

Output RINEX GEO navigation data file body.

Parameters
[in]fpOutput file pointer
[in]optRINEX options
[in]sephSBAS ephemeris
Returns
Status (1:ok, 0:output error)

Definition at line 3570 of file mrtk_rinex.c.

References seph_t::acc, seph_t::af0, seph_t::af1, rnxopt_t::navsys, outnavf(), seph_t::pos, rnxopt_t::rnxver, seph_t::sat, sat2code(), satsys(), seph_t::sva, seph_t::svh, SYS_SBS, seph_t::t0, time2epoch(), time2gpst(), seph_t::tof, trace(), uravalue(), and seph_t::vel.

Referenced by convnav(), and convsbs().

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

◆ outrnxhnavh()

int outrnxhnavh ( FILE * fp,
const rnxopt_t * opt,
const nav_t * nav )

Output RINEX GEO navigation data file header.

Parameters
[in]fpOutput file pointer
[in]optRINEX options
[in]navNavigation data (NULL: no input)
Returns
Status (1:ok, 0:output error)

Definition at line 3535 of file mrtk_rinex.c.

References rnxopt_t::comment, MAXCOMMENT, out_leaps(), out_time(), rnxopt_t::prog, rnxopt_t::rnxver, rnxopt_t::runby, SYS_GPS, SYS_SBS, timestr_rnx(), and trace().

Referenced by write_header().

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

◆ outrnxinavh()

int outrnxinavh ( FILE * fp,
const rnxopt_t * opt,
const nav_t * nav )

Output RINEX NavIC/IRNSS navigation data file header.

Parameters
[in]fpOutput file pointer
[in]optRINEX options
[in]navNavigation data (NULL: no input)
Returns
Status (1:ok, 0:output error)

Definition at line 3733 of file mrtk_rinex.c.

References rnxopt_t::comment, MAXCOMMENT, out_iono(), out_leaps(), out_time(), rnxopt_t::prog, rnxopt_t::rnxver, rnxopt_t::runby, SYS_IRN, timestr_rnx(), and trace().

Referenced by write_header().

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

◆ outrnxlnavh()

int outrnxlnavh ( FILE * fp,
const rnxopt_t * opt,
const nav_t * nav )

Output RINEX Galileo navigation data file header.

Parameters
[in]fpOutput file pointer
[in]optRINEX options
[in]navNavigation data (NULL: no input)
Returns
Status (1:ok, 0:output error)

Definition at line 3625 of file mrtk_rinex.c.

References rnxopt_t::comment, MAXCOMMENT, out_iono(), out_leaps(), out_time(), rnxopt_t::prog, rnxopt_t::rnxver, rnxopt_t::runby, SYS_GAL, timestr_rnx(), and trace().

Referenced by write_header().

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

◆ outrnxnavb()

int outrnxnavb ( FILE * fp,
const rnxopt_t * opt,
const eph_t * eph )

Output RINEX navigation data file body.

Parameters
[in]fpOutput file pointer
[in]optRINEX options
[in]ephEphemeris
Returns
Status (1:ok, 0:output error)

Definition at line 3320 of file mrtk_rinex.c.

References eph_t::A, eph_t::cic, eph_t::cis, eph_t::code, eph_t::crc, eph_t::crs, eph_t::cuc, eph_t::cus, eph_t::deln, eph_t::e, eph_t::f0, eph_t::f1, eph_t::f2, eph_t::fit, eph_t::flag, gpst2bdt(), eph_t::i0, eph_t::idot, eph_t::iodc, eph_t::iode, eph_t::M0, rnxopt_t::navsys, eph_t::omg, eph_t::OMG0, eph_t::OMGd, outnavf(), rnxopt_t::rnxver, eph_t::sat, sat2code(), satsys(), sisa_value(), eph_t::sva, eph_t::svh, SYS_CMP, SYS_GAL, SYS_GPS, SYS_IRN, SYS_QZS, eph_t::tgd, time2bdt(), time2epoch(), time2gpst(), eph_t::toc, eph_t::toes, trace(), eph_t::ttr, uravalue(), and eph_t::week.

Referenced by convnav().

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

◆ outrnxnavh()

int outrnxnavh ( FILE * fp,
const rnxopt_t * opt,
const nav_t * nav )

Output RINEX navigation data file header.

Parameters
[in]fpOutput file pointer
[in]optRINEX options
[in]navNavigation data (NULL: no input)
Returns
Status (1:ok, 0:output error)

Definition at line 3264 of file mrtk_rinex.c.

References rnxopt_t::comment, MAXCOMMENT, rnxopt_t::navsys, out_iono(), out_leaps(), out_time(), rnxopt_t::prog, rnxopt_t::rnxver, rnxopt_t::runby, rnxopt_t::sep_nav, SYS_ALL, SYS_CMP, SYS_GAL, SYS_GLO, SYS_GPS, SYS_IRN, SYS_QZS, SYS_SBS, timestr_rnx(), and trace().

Referenced by write_header().

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

◆ outrnxobsb()

int outrnxobsb ( FILE * fp,
const rnxopt_t * opt,
const obsd_t * obs,
int n,
int flag )

Output RINEX observation data body.

Parameters
[in]fpOutput file pointer
[in]optRINEX options
[in]obsObservation data
[in]nNumber of observation data
[in]flagEpoch flag (0:ok,1:power failure,>1:event flag)
Returns
Status (1:ok, 0:output error)

Definition at line 2992 of file mrtk_rinex.c.

References obsd_t::code, rnxopt_t::exsats, obsd_t::L, rnxopt_t::mask, MAXOBS, rnxopt_t::navsys, rnxopt_t::nobs, obsindex(), outrnxobsf(), rnxopt_t::rnxver, obsd_t::sat, sat2code(), satsys(), rnxopt_t::shift, SNR_UNIT, SYS_CMP, SYS_GAL, SYS_GLO, SYS_GPS, SYS_IRN, SYS_QZS, SYS_SBS, time2epoch(), rnxopt_t::tobs, and trace().

Referenced by convobs().

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

◆ outrnxobsh()

int outrnxobsh ( FILE * fp,
const rnxopt_t * opt,
const nav_t * nav )

Output RINEX observation data file header.

Parameters
[in]fpOutput file pointer
[in]optRINEX options
[in]navNavigation data
Returns
Status (1:ok, 0:output error)

Definition at line 2813 of file mrtk_rinex.c.

References rnxopt_t::ant, rnxopt_t::antdel, rnxopt_t::apppos, rnxopt_t::comment, rnxopt_t::marker, rnxopt_t::markerno, rnxopt_t::markertype, MAXCOMMENT, rnxopt_t::name, rnxopt_t::navsys, outobstype_ver2(), outobstype_ver3(), outrnx_glo_bias(), outrnx_glo_fcn(), outrnx_phase_shift(), rnxopt_t::prog, rnxopt_t::rec, rnxopt_t::rnxver, rnxopt_t::runby, SYS_CMP, SYS_GAL, SYS_GLO, SYS_GPS, SYS_IRN, SYS_QZS, SYS_SBS, rnxopt_t::tend, time2epoch(), timestr_rnx(), rnxopt_t::tint, trace(), and rnxopt_t::tstart.

Referenced by write_header().

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

◆ outrnxqnavh()

int outrnxqnavh ( FILE * fp,
const rnxopt_t * opt,
const nav_t * nav )

Output RINEX QZSS navigation data file header.

Parameters
[in]fpOutput file pointer
[in]optRINEX options
[in]navNavigation data (NULL: no input)
Returns
Status (1:ok, 0:output error)

Definition at line 3661 of file mrtk_rinex.c.

References rnxopt_t::comment, MAXCOMMENT, out_iono(), out_leaps(), out_time(), rnxopt_t::prog, rnxopt_t::rnxver, rnxopt_t::runby, SYS_QZS, timestr_rnx(), and trace().

Referenced by write_header().

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

◆ readrnx()

int readrnx ( const char * file,
int rcv,
const char * opt,
obs_t * obs,
nav_t * nav,
sta_t * sta )

Read RINEX OBS and NAV files.

Parameters
[in]fileFile path (wild-card * expanded) ("": stdin)
[in]rcvReceiver number for obs data
[in]optRINEX options ("": no option)
[in,out]obsObservation data (NULL: no input)
[in,out]navNavigation data (NULL: no input)
[in,out]staStation parameters (NULL: no input)
Returns
Status (1:ok, 0:no data, -1:error)

Definition at line 2362 of file mrtk_rinex.c.

References readrnxt(), and trace().

Here is the call graph for this function:

◆ readrnxc()

int readrnxc ( const char * file,
nav_t * nav )

Read RINEX clock files.

Parameters
[in]fileFile path (wild-card * expanded)
[in,out]navNavigation data (NULL: no input)
Returns
Number of precise clock records

Definition at line 2421 of file mrtk_rinex.c.

References combpclk(), expath(), free, malloc, MAXEXFILE, nav_s::nc, readrnxfile(), and trace().

Referenced by decodefile(), and readpreceph().

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

◆ readrnxt()

int readrnxt ( const char * file,
int rcv,
gtime_t ts,
gtime_t te,
double tint,
const char * opt,
obs_t * obs,
nav_t * nav,
sta_t * sta )

Read RINEX OBS and NAV files with time span.

Parameters
[in]fileFile path (wild-card * expanded) ("": stdin)
[in]rcvReceiver number for obs data
[in]tsObservation time start (ts.time==0: no limit)
[in]teObservation time end (te.time==0: no limit)
[in]tintObservation time interval (s) (0:all)
[in]optRINEX options ("": no option)
[in,out]obsObservation data (NULL: no input)
[in,out]navNavigation data (NULL: no input)
[in,out]staStation parameters (NULL: no input)
Returns
Status (1:ok, 0:no data, -1:error)

Definition at line 2317 of file mrtk_rinex.c.

References expath(), FILEPATHSEP, free, malloc, MAXEXFILE, sta_t::name, readrnxfile(), readrnxfp(), setstr(), and trace().

Referenced by readobsnav(), and readrnx().

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