|
MRTKLIB 0.7.14
Modernized GNSS Positioning Library
|
#include "mrtklib/mrtk_madoca_local_corr.h"#include <math.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include "mrtklib/mrtk_atmos.h"#include "mrtklib/mrtk_coords.h"#include "mrtklib/mrtk_mat.h"#include "mrtklib/mrtk_trace.h"Go to the source code of this file.
Macros | |
| #define | PI 3.1415926535897932 |
| #define | D2R (PI / 180.0) |
| #define | R2D (180.0 / PI) |
| #define | PRN_ZTD 1E-4 /* process noise of ztd (m/sqrt(s)) */ |
| #define | PRN_GRAD 1E-5 /* process noise of gradient (m/sqrt(s)) */ |
| #define | STD_ZTD_DIST 1E-4 /* distance dependent factor ztd (m/km) */ |
| #define | STD_GRAD_DIST 1E-5 /* distance dependent factor gradient (m/km) */ |
| #define | STD_VTEC_DIST 1E-3 /* distance dependent factor vtec (m/km) */ |
| #define | SQR(x) |
| #define | MAX(x, y) |
| #define | GN(gp) |
Functions | |
| int | satid2no (const char *id) |
| char * | time_str (gtime_t t, int n) |
| int | getstano (stat_t *stat, const char *pntname) |
| Search for a point by name or add a new point if not found. | |
| static int | decode_stat (sstat_t *sstat, char *buff, int *nbyte) |
| 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. | |
| static int | get_site (const stat_t *stat, const double *llh, int iontrp, int *siteno, double maxdist, double *dist, double gllh[][3]) |
| 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. | |
| #define D2R (PI / 180.0) |
Definition at line 30 of file mrtk_madoca_local_corr.c.
| #define GN | ( | gp | ) |
Definition at line 42 of file mrtk_madoca_local_corr.c.
| #define MAX | ( | x, | |
| y ) |
Definition at line 41 of file mrtk_madoca_local_corr.c.
Referenced by get_site().
| #define PI 3.1415926535897932 |
Definition at line 29 of file mrtk_madoca_local_corr.c.
| #define PRN_GRAD 1E-5 /* process noise of gradient (m/sqrt(s)) */ |
Definition at line 35 of file mrtk_madoca_local_corr.c.
Referenced by get_trop_sta().
| #define PRN_ZTD 1E-4 /* process noise of ztd (m/sqrt(s)) */ |
Definition at line 34 of file mrtk_madoca_local_corr.c.
Referenced by get_trop_sta().
| #define R2D (180.0 / PI) |
Definition at line 31 of file mrtk_madoca_local_corr.c.
| #define SQR | ( | x | ) |
Definition at line 40 of file mrtk_madoca_local_corr.c.
Referenced by corr_iono_distwgt(), corr_trop_distwgt(), and get_trop_sta().
| #define STD_GRAD_DIST 1E-5 /* distance dependent factor gradient (m/km) */ |
Definition at line 37 of file mrtk_madoca_local_corr.c.
Referenced by corr_trop_distwgt().
| #define STD_VTEC_DIST 1E-3 /* distance dependent factor vtec (m/km) */ |
Definition at line 38 of file mrtk_madoca_local_corr.c.
Referenced by corr_iono_distwgt().
| #define STD_ZTD_DIST 1E-4 /* distance dependent factor ztd (m/km) */ |
Definition at line 36 of file mrtk_madoca_local_corr.c.
Referenced by corr_trop_distwgt().
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().
|
extern |
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().
|
extern |
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().
|
static |
Definition at line 79 of file mrtk_madoca_local_corr.c.
References ion_t::azel, D2R, spos_t::ecef, gpst2time(), ion_t::ion, siteion_t::iond, ion_t::qflag, trp_t::qflag, satid2no(), satno(), sstat_t::sion, siteion_t::site, sitetrp_t::site, ion_t::std, trp_t::std, sstat_t::strp, ion_t::time, sstat_t::time, trp_t::time, timediff(), trp_t::trp, and sitetrp_t::trpd.
Referenced by input_stat().
|
extern |
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().
|
static |
Definition at line 200 of file mrtk_madoca_local_corr.c.
References spos_t::ecef, ecef2pos(), MAX, stat_t::nsi, stat_t::nst, pos2ecef(), posdist(), R2D, stat_t::sion, siteion_t::site, sitetrp_t::site, stat_t::strp, trace(), TYPE_ION, and TYPE_TRP.
Referenced by corr_iono_distwgt(), and corr_trop_distwgt().
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().
|
extern |
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().
|
extern |
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().
|
extern |
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().
|
extern |
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().
|
extern |
Definition at line 753 of file mrtk_nav.c.
Referenced by decode_stat().
|
extern |
Definition at line 530 of file mrtk_time.c.
Referenced by corr_iono_distwgt(), corr_trop_distwgt(), get_iono_sta(), and get_trop_sta().