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

MRTKLIB MADOCA Local Correction Module — local correction common functions and constants. More...

Include dependency graph for mrtk_madoca_local_corr.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define TYPE_TRP   0 /* data type of troposphere */
#define TYPE_ION   1 /* data type of ionosphere */
#define MAX_DIST_TRP   100.0 /* max distance for tropospheric correction (km) */
#define MAX_DIST_ION   50.0 /* max distance for ionospheric correction (km) */
#define MODE_PLANE   0 /* interpolation mode planer fitting */
#define MODE_DISTWGT   1 /* interpolation mode weighted average of distance */
#define BTYPE_GRID   0 /* block type grid */
#define BTYPE_STA   1 /* block type station */
#define ION_BLKSIZE   2.0 /* ionosphere block size */
#define TRP_BLKSIZE   4.0 /* troposphere block size */
#define MAX_STANAME   16 /* max length of station name */

Functions

int getstano (stat_t *stat, const char *pntname)
 Search for a point by name or add a new point if not found.
int input_stat (sstat_t *sstat, const char data, char *buff, int *nbyte)
 Stack stat message and synchronize frame with stat preamble.
int input_statf (sstat_t *sstat, FILE *fp, char *buff, int *nbyte)
 Fetch next stat message and input a message from file.
double posdist (const double *ecef1, const double *ecef2)
 Calculate the Euclidean distance between two ECEF positions.
int get_trop_sta (gtime_t time, const trp_t *trpd, double *trp, double *std)
 Get tropospheric correction for a point.
int get_iono_sta (gtime_t time, const ion_t *iond, double *ion, double *std, double *el)
 Get ionospheric correction for a point.
int corr_trop_distwgt (const stat_t *stat, gtime_t time, const double *llh, double maxdist, double *trp, double *std)
 Calculate tropospheric correction using weighted interpolation by distance.
int corr_iono_distwgt (const stat_t *stat, gtime_t time, const double *llh, const double *el, double maxdist, double *ion, double *std, double maxres, int *nrej, int *ncnt)
 Calculate ionospheric correction using weighted interpolation by distance.
int block2stat (rtcm_t *rtcm, stat_t *stat)
 Convert RTCM3 block data to station statistics.

Detailed Description

MRTKLIB MADOCA Local Correction Module — local correction common functions and constants.

This header provides functions for local tropospheric and ionospheric correction data processing, extracted from lclcmn.c with zero algorithmic changes.

Note
Functions declared here are implemented in mrtk_madoca_local_corr.c.

Definition in file mrtk_madoca_local_corr.h.

Macro Definition Documentation

◆ BTYPE_GRID

#define BTYPE_GRID   0 /* block type grid */

Definition at line 49 of file mrtk_madoca_local_corr.h.

◆ BTYPE_STA

#define BTYPE_STA   1 /* block type station */

Definition at line 50 of file mrtk_madoca_local_corr.h.

◆ ION_BLKSIZE

#define ION_BLKSIZE   2.0 /* ionosphere block size */

Definition at line 51 of file mrtk_madoca_local_corr.h.

◆ MAX_DIST_ION

#define MAX_DIST_ION   50.0 /* max distance for ionospheric correction (km) */

Definition at line 46 of file mrtk_madoca_local_corr.h.

◆ MAX_DIST_TRP

#define MAX_DIST_TRP   100.0 /* max distance for tropospheric correction (km) */

Definition at line 45 of file mrtk_madoca_local_corr.h.

◆ MAX_STANAME

#define MAX_STANAME   16 /* max length of station name */

Definition at line 53 of file mrtk_madoca_local_corr.h.

◆ MODE_DISTWGT

#define MODE_DISTWGT   1 /* interpolation mode weighted average of distance */

Definition at line 48 of file mrtk_madoca_local_corr.h.

◆ MODE_PLANE

#define MODE_PLANE   0 /* interpolation mode planer fitting */

Definition at line 47 of file mrtk_madoca_local_corr.h.

Referenced by grid_intp_iono(), and grid_intp_trop().

◆ TRP_BLKSIZE

#define TRP_BLKSIZE   4.0 /* troposphere block size */

Definition at line 52 of file mrtk_madoca_local_corr.h.

◆ TYPE_ION

#define TYPE_ION   1 /* data type of ionosphere */

Definition at line 44 of file mrtk_madoca_local_corr.h.

Referenced by corr_iono_distwgt(), corr_iono_plane(), and get_site().

◆ TYPE_TRP

#define TYPE_TRP   0 /* data type of troposphere */

Function Documentation

◆ block2stat()

int block2stat ( rtcm_t * rtcm,
stat_t * stat )

Convert RTCM3 block data to station statistics.

Parameters
[in,out]rtcmRTCM control struct
[in,out]statStation data struct
Returns
Status (0: error, 1: success)

Definition at line 413 of file mrtk_madoca_local_corr.c.

References BTYPE_GRID, spos_t::ecef, stat_t::nsi, stat_t::nst, posdist(), rtcm, stat_t::sion, siteion_t::site, sitetrp_t::site, stat_t::strp, and stat_t::time.

Referenced by update_lcl(), and update_rtcm().

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

◆ corr_iono_distwgt()

int corr_iono_distwgt ( const stat_t * stat,
gtime_t time,
const double * llh,
const double * el,
double maxdist,
double * ion,
double * std,
double maxres,
int * nrej,
int * ncnt )

Calculate ionospheric correction using weighted interpolation by distance.

Parameters
[in]statLocal correction data
[in]timeTime (GPST)
[in]llhReceiver position {lat, lon, hgt} (rad, m)
[in]elReceiver to satellite elevation (rad)
[in]maxdistMax distance threshold (km)
[out]ionL1 slant ionospheric delay for each sat (MAXSAT x 1)
[out]stdStandard deviation (m)
[in]maxresMaximum residual threshold (m)
[out]nrejNumber of rejected stations
[out]ncntNumber of counted stations
Returns
Status (1:ok, 0:error)

Definition at line 342 of file mrtk_madoca_local_corr.c.

References get_iono_sta(), get_site(), siteion_t::iond, MAXSAT, MAXSITES, R2D, stat_t::sion, SQR, STD_VTEC_DIST, time_str(), trace(), and TYPE_ION.

Referenced by grid_intp_iono().

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

◆ corr_trop_distwgt()

int corr_trop_distwgt ( const stat_t * stat,
gtime_t time,
const double * llh,
double maxdist,
double * trp,
double * std )

Calculate tropospheric correction using weighted interpolation by distance.

Parameters
[in]statCorrection data
[in]timeTime (GPST)
[in]llhReceiver position {lat, lon, hgt} (rad, m)
[in]maxdistMax distance threshold (km)
[out]trpTropospheric parameters {ztd, grade, gradn} (m)
[out]stdStandard deviation (m)
Returns
Status (1:ok, 0:error)

Definition at line 282 of file mrtk_madoca_local_corr.c.

References get_site(), get_trop_sta(), MAXSITES, PI, R2D, SQR, STD_GRAD_DIST, STD_ZTD_DIST, stat_t::strp, time_str(), trace(), tropmodel(), sitetrp_t::trpd, and TYPE_TRP.

Referenced by grid_intp_trop().

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

◆ get_iono_sta()

int get_iono_sta ( gtime_t time,
const ion_t * iond,
double * ion,
double * std,
double * el )

Get ionospheric correction for a point.

Parameters
[in]timeTime (GPST)
[in]iondIonospheric correction data (MAXSAT elements)
[out]ionIonospheric delay for each satellite (m)
[out]stdStandard deviation (m)
[out]elElevation angle (rad)
Returns
Number of valid corrections

Definition at line 252 of file mrtk_madoca_local_corr.c.

References ion_t::azel, ion_t::ion, MAXSAT, ion_t::std, time_str(), timediff(), and trace().

Referenced by corr_iono_distwgt(), and corr_iono_plane().

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

◆ get_trop_sta()

int get_trop_sta ( gtime_t time,
const trp_t * trpd,
double * trp,
double * std )

Get tropospheric correction for a point.

Parameters
[in]timeTime (GPST)
[in]trpdTropospheric correction data
[out]trpTropospheric parameters {ztd, grade, gradn} (m)
[out]stdStandard deviation (m)
Returns
Status (1:ok, 0:error)

Definition at line 235 of file mrtk_madoca_local_corr.c.

References PRN_GRAD, PRN_ZTD, SQR, trp_t::std, trp_t::time, time_str(), timediff(), trace(), and trp_t::trp.

Referenced by corr_trop_distwgt(), and corr_trop_plane().

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

◆ getstano()

int getstano ( stat_t * stat,
const char * pntname )

Search for a point by name or add a new point if not found.

Parameters
[in,out]statLocal correction data
[in]pntnamePoint name
Returns
Point index (>=0: found or added, 0: error)

Definition at line 55 of file mrtk_madoca_local_corr.c.

References MAXSITES, spos_t::name, stat_t::nsi, stat_t::nst, stat_t::sion, siteion_t::site, sitetrp_t::site, and stat_t::strp.

Referenced by update_stat(), and update_stat().

Here is the caller graph for this function:

◆ input_stat()

int input_stat ( sstat_t * sstat,
const char data,
char * buff,
int * nbyte )

Stack stat message and synchronize frame with stat preamble.

Parameters
[in,out]sstatLocal correction data
[in]dataStat 1-byte data
[out]buffBuffer for message
[in,out]nbyteNumber of bytes
Returns
Status (-1: error, 0: no message, 11: input stat messages)

Definition at line 141 of file mrtk_madoca_local_corr.c.

References decode_stat(), and trace().

Referenced by decoderaw(), and input_statf().

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

◆ input_statf()

int input_statf ( sstat_t * sstat,
FILE * fp,
char * buff,
int * nbyte )

Fetch next stat message and input a message from file.

Parameters
[in,out]sstatLocal correction data
[in]fpFile pointer
[out]buffBuffer for message
[in,out]nbyteNumber of bytes
Returns
Status (-2: end of file, -1...11: same as input_stat())

Definition at line 170 of file mrtk_madoca_local_corr.c.

References input_stat(), and trace().

Referenced by update_stat().

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

◆ posdist()

double posdist ( const double * ecef1,
const double * ecef2 )

Calculate the Euclidean distance between two ECEF positions.

Parameters
[in]ecef1Position 1 (ECEF coordinates)
[in]ecef2Position 2 (ECEF coordinates)
Returns
Distance between the two positions (m)

Definition at line 191 of file mrtk_madoca_local_corr.c.

References norm().

Referenced by block2stat(), get_site(), and selpersta().

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