|
MRTKLIB 0.7.14
Modernized GNSS Positioning Library
|
MRTKLIB MADOCA Local Correction Module — local correction common functions and constants. More...
#include "mrtklib/mrtk_foundation.h"#include "mrtklib/mrtk_nav.h"#include "mrtklib/mrtk_rtcm.h"#include "mrtklib/mrtk_time.h"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. | |
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.
Definition in file mrtk_madoca_local_corr.h.
| #define BTYPE_GRID 0 /* block type grid */ |
Definition at line 49 of file mrtk_madoca_local_corr.h.
| #define BTYPE_STA 1 /* block type station */ |
Definition at line 50 of file mrtk_madoca_local_corr.h.
| #define ION_BLKSIZE 2.0 /* ionosphere block size */ |
Definition at line 51 of file mrtk_madoca_local_corr.h.
| #define MAX_DIST_ION 50.0 /* max distance for ionospheric correction (km) */ |
Definition at line 46 of file mrtk_madoca_local_corr.h.
| #define MAX_DIST_TRP 100.0 /* max distance for tropospheric correction (km) */ |
Definition at line 45 of file mrtk_madoca_local_corr.h.
| #define MAX_STANAME 16 /* max length of station name */ |
Definition at line 53 of file mrtk_madoca_local_corr.h.
| #define MODE_DISTWGT 1 /* interpolation mode weighted average of distance */ |
Definition at line 48 of file mrtk_madoca_local_corr.h.
| #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().
| #define TRP_BLKSIZE 4.0 /* troposphere block size */ |
Definition at line 52 of file mrtk_madoca_local_corr.h.
| #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().
| #define TYPE_TRP 0 /* data type of troposphere */ |
Definition at line 43 of file mrtk_madoca_local_corr.h.
Referenced by corr_trop_distwgt(), corr_trop_plane(), get_site(), gettriangledd(), and selpersta().
Convert RTCM3 block data to station statistics.
| [in,out] | rtcm | RTCM control struct |
| [in,out] | stat | Station data struct |
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().
| 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.
| [in] | stat | Local correction data |
| [in] | time | Time (GPST) |
| [in] | llh | Receiver position {lat, lon, hgt} (rad, m) |
| [in] | el | Receiver to satellite elevation (rad) |
| [in] | maxdist | Max distance threshold (km) |
| [out] | ion | L1 slant ionospheric delay for each sat (MAXSAT x 1) |
| [out] | std | Standard deviation (m) |
| [in] | maxres | Maximum residual threshold (m) |
| [out] | nrej | Number of rejected stations |
| [out] | ncnt | Number of counted stations |
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().
| 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.
| [in] | stat | Correction data |
| [in] | time | Time (GPST) |
| [in] | llh | Receiver position {lat, lon, hgt} (rad, m) |
| [in] | maxdist | Max distance threshold (km) |
| [out] | trp | Tropospheric parameters {ztd, grade, gradn} (m) |
| [out] | std | Standard deviation (m) |
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().
Get ionospheric correction for a point.
| [in] | time | Time (GPST) |
| [in] | iond | Ionospheric correction data (MAXSAT elements) |
| [out] | ion | Ionospheric delay for each satellite (m) |
| [out] | std | Standard deviation (m) |
| [out] | el | Elevation angle (rad) |
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().
Get tropospheric correction for a point.
| [in] | time | Time (GPST) |
| [in] | trpd | Tropospheric correction data |
| [out] | trp | Tropospheric parameters {ztd, grade, gradn} (m) |
| [out] | std | Standard deviation (m) |
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().
| int getstano | ( | stat_t * | stat, |
| const char * | pntname ) |
Search for a point by name or add a new point if not found.
| [in,out] | stat | Local correction data |
| [in] | pntname | Point name |
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().
| int input_stat | ( | sstat_t * | sstat, |
| const char | data, | ||
| char * | buff, | ||
| int * | nbyte ) |
Stack stat message and synchronize frame with stat preamble.
| [in,out] | sstat | Local correction data |
| [in] | data | Stat 1-byte data |
| [out] | buff | Buffer for message |
| [in,out] | nbyte | Number of bytes |
Definition at line 141 of file mrtk_madoca_local_corr.c.
References decode_stat(), and trace().
Referenced by decoderaw(), and input_statf().
| int input_statf | ( | sstat_t * | sstat, |
| FILE * | fp, | ||
| char * | buff, | ||
| int * | nbyte ) |
Fetch next stat message and input a message from file.
| [in,out] | sstat | Local correction data |
| [in] | fp | File pointer |
| [out] | buff | Buffer for message |
| [in,out] | nbyte | Number of bytes |
Definition at line 170 of file mrtk_madoca_local_corr.c.
References input_stat(), and trace().
Referenced by update_stat().
| double posdist | ( | const double * | ecef1, |
| const double * | ecef2 ) |
Calculate the Euclidean distance between two ECEF positions.
| [in] | ecef1 | Position 1 (ECEF coordinates) |
| [in] | ecef2 | Position 2 (ECEF coordinates) |
Definition at line 191 of file mrtk_madoca_local_corr.c.
References norm().
Referenced by block2stat(), get_site(), and selpersta().