MRTKLIB 0.7.14
Modernized GNSS Positioning Library
Loading...
Searching...
No Matches
mrtk_atmos.c File Reference

MRTKLIB Atmosphere Module — Ionospheric and tropospheric models. More...

#include "mrtklib/mrtk_atmos.h"
#include <math.h>
#include "mrtklib/mrtk_ionex.h"
#include "mrtklib/mrtk_sbas.h"
#include "mrtklib/mrtk_trace.h"
Include dependency graph for mrtk_atmos.c:

Go to the source code of this file.

Macros

#define PI   3.1415926535897932 /* pi */
#define D2R   (PI / 180.0) /* deg to rad */
#define R2D   (180.0 / PI) /* rad to deg */
#define CLIGHT   299792458.0 /* speed of light (m/s) */
#define RE_WGS84   6378137.0 /* earth semimajor axis (WGS84) (m) */
#define HION   350000.0 /* ionosphere height (m) */
#define SQR(x)
#define ERR_ION   5.0 /* ionospheric delay Std (m) */
#define ERR_TROP   3.0 /* tropspheric delay Std (m) */
#define ERR_SAAS   0.3 /* Saastamoinen model error Std (m) */
#define ERR_BRDCI   0.5 /* broadcast ionosphere model error factor */
#define REL_HUMI   0.7 /* relative humidity for Saastamoinen model */

Functions

double ionmodel (gtime_t t, const double *ion, const double *pos, const double *azel)
 Compute ionospheric delay by broadcast ionosphere model (Klobuchar).
double ionmapf (const double *pos, const double *azel)
 Compute ionospheric delay mapping function by single layer model.
double ionppp (const double *pos, const double *azel, double re, double hion, double *posp)
 Compute ionospheric pierce point (IPP) position and slant factor.
double tropmodel (gtime_t time, const double *pos, const double *azel, double humi)
 Compute tropospheric delay by standard atmosphere and Saastamoinen.
static double interpc (const double coef[], double lat)
static double mapf (double el, double a, double b, double c)
static double nmf (gtime_t time, const double pos[], const double azel[], double *mapfw)
double tropmapf (gtime_t time, const double pos[], const double azel[], double *mapfw)
int ionocorr (gtime_t time, const nav_t *nav, int sat, const double *pos, const double *azel, int ionoopt, double *ion, double *var)
 Compute ionospheric correction.
int tropcorr (gtime_t time, const nav_t *nav, const double *pos, const double *azel, int tropopt, double *trp, double *var)
 Compute tropospheric correction.

Detailed Description

MRTKLIB Atmosphere Module — Ionospheric and tropospheric models.

This file contains all broadcast ionosphere and troposphere model functions extracted from rtkcmn.c with zero algorithmic changes (pure cut-and-paste).

Definition in file mrtk_atmos.c.

Macro Definition Documentation

◆ CLIGHT

#define CLIGHT   299792458.0 /* speed of light (m/s) */

Definition at line 38 of file mrtk_atmos.c.

◆ D2R

#define D2R   (PI / 180.0) /* deg to rad */

Definition at line 36 of file mrtk_atmos.c.

◆ ERR_BRDCI

#define ERR_BRDCI   0.5 /* broadcast ionosphere model error factor */

Definition at line 295 of file mrtk_atmos.c.

Referenced by ionocorr(), and model_iono().

◆ ERR_ION

#define ERR_ION   5.0 /* ionospheric delay Std (m) */

Definition at line 292 of file mrtk_atmos.c.

Referenced by ionocorr().

◆ ERR_SAAS

#define ERR_SAAS   0.3 /* Saastamoinen model error Std (m) */

Definition at line 294 of file mrtk_atmos.c.

Referenced by model_trop(), and tropcorr().

◆ ERR_TROP

#define ERR_TROP   3.0 /* tropspheric delay Std (m) */

Definition at line 293 of file mrtk_atmos.c.

Referenced by tropcorr().

◆ HION

#define HION   350000.0 /* ionosphere height (m) */

Definition at line 40 of file mrtk_atmos.c.

Referenced by ionmapf().

◆ PI

#define PI   3.1415926535897932 /* pi */

Definition at line 35 of file mrtk_atmos.c.

◆ R2D

#define R2D   (180.0 / PI) /* rad to deg */

Definition at line 37 of file mrtk_atmos.c.

◆ RE_WGS84

#define RE_WGS84   6378137.0 /* earth semimajor axis (WGS84) (m) */

Definition at line 39 of file mrtk_atmos.c.

◆ REL_HUMI

#define REL_HUMI   0.7 /* relative humidity for Saastamoinen model */

Definition at line 296 of file mrtk_atmos.c.

Referenced by model_trop(), and tropcorr().

◆ SQR

#define SQR ( x)
Value:
((x) * (x))

Definition at line 291 of file mrtk_atmos.c.

Referenced by ionocorr(), and tropcorr().

Function Documentation

◆ interpc()

double interpc ( const double coef[],
double lat )
static

Definition at line 185 of file mrtk_atmos.c.

Referenced by nmf().

Here is the caller graph for this function:

◆ ionmapf()

double ionmapf ( const double * pos,
const double * azel )
extern

Compute ionospheric delay mapping function by single layer model.

Parameters
[in]posReceiver position {lat,lon,h} (rad,m)
[in]azelAzimuth/elevation angle {az,el} (rad)
Returns
Ionospheric mapping function

Definition at line 114 of file mrtk_atmos.c.

References HION, PI, and RE_WGS84.

Referenced by ddres(), ddres(), and ddres().

Here is the caller graph for this function:

◆ ionmodel()

double ionmodel ( gtime_t t,
const double * ion,
const double * pos,
const double * azel )
extern

Compute ionospheric delay by broadcast ionosphere model (Klobuchar).

Parameters
[in]tTime (GPST)
[in]ionIono model parameters {a0,a1,a2,a3,b0,b1,b2,b3}
[in]posReceiver position {lat,lon,h} (rad,m)
[in]azelAzimuth/elevation angle {az,el} (rad)
Returns
Ionospheric delay (L1) (m)

Definition at line 63 of file mrtk_atmos.c.

References CLIGHT, norm(), PI, and time2gpst().

Referenced by ionocorr(), and model_iono().

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

◆ ionocorr()

int ionocorr ( gtime_t time,
const nav_t * nav,
int sat,
const double * pos,
const double * azel,
int ionoopt,
double * ion,
double * var )

Compute ionospheric correction.

Parameters
[in]timeTime
[in]navNavigation data
[in]satSatellite number
[in]posReceiver position {lat,lon,h} (rad|m)
[in]azelAzimuth/elevation angle {az,el} (rad)
[in]ionooptIonospheric correction option (IONOOPT_???)
[out]ionIonospheric delay (L1) (m)
[out]varIonospheric delay (L1) variance (m^2)
Returns
Status (1:ok, 0:error)

Definition at line 310 of file mrtk_atmos.c.

References ERR_BRDCI, ERR_ION, nav_s::ion_gps, nav_s::ion_qzs, ionmodel(), IONOOPT_BRDC, IONOOPT_OFF, IONOOPT_QZS, IONOOPT_SBAS, IONOOPT_TEC, iontec(), norm(), R2D, sbsioncorr(), SQR, time_str(), and trace().

Referenced by rescode().

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

◆ ionppp()

double ionppp ( const double * pos,
const double * azel,
double re,
double hion,
double * posp )
extern

Compute ionospheric pierce point (IPP) position and slant factor.

Parameters
[in]posReceiver position {lat,lon,h} (rad,m)
[in]azelAzimuth/elevation angle {az,el} (rad)
[in]reEarth radius (km)
[in]hionAltitude of ionosphere (km)
[out]pospPierce point position {lat,lon,h} (rad,m)
Returns
Slant factor
Note
Only valid on the earth surface.

Definition at line 131 of file mrtk_atmos.c.

References D2R, and PI.

Referenced by iondelay(), and sbsioncorr().

Here is the caller graph for this function:

◆ mapf()

double mapf ( double el,
double a,
double b,
double c )
static

Definition at line 194 of file mrtk_atmos.c.

Referenced by nmf().

Here is the caller graph for this function:

◆ nmf()

double nmf ( gtime_t time,
const double pos[],
const double azel[],
double * mapfw )
static

Definition at line 198 of file mrtk_atmos.c.

References interpc(), mapf(), PI, R2D, and time2doy().

Referenced by tropmapf().

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

◆ tropcorr()

int tropcorr ( gtime_t time,
const nav_t * nav,
const double * pos,
const double * azel,
int tropopt,
double * trp,
double * var )

Compute tropospheric correction.

Parameters
[in]timeTime
[in]navNavigation data
[in]posReceiver position {lat,lon,h} (rad|m)
[in]azelAzimuth/elevation angle {az,el} (rad)
[in]tropoptTropospheric correction option (TROPOPT_???)
[out]trpTropospheric delay (m)
[out]varTropospheric delay variance (m^2)
Returns
Status (1:ok, 0:error)

Definition at line 350 of file mrtk_atmos.c.

References ERR_SAAS, ERR_TROP, R2D, REL_HUMI, sbstropcorr(), SQR, time_str(), trace(), tropmodel(), TROPOPT_EST, TROPOPT_ESTG, TROPOPT_OFF, TROPOPT_SAAS, and TROPOPT_SBAS.

Referenced by rescode().

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

◆ tropmapf()

double tropmapf ( gtime_t time,
const double pos[],
const double azel[],
double * mapfw )
extern

Definition at line 256 of file mrtk_atmos.c.

References epoch2time(), geoidh(), nmf(), PI, R2D, timediff(), and trace().

Referenced by clas_osr_prectrop(), prectrop(), prectrop(), prectrop2(), zdres(), and zdres().

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

◆ tropmodel()

double tropmodel ( gtime_t time,
const double * pos,
const double * azel,
double humi )
extern

Compute tropospheric delay by standard atmosphere and Saastamoinen.

Parameters
[in]timeTime
[in]posReceiver position {lat,lon,h} (rad,m)
[in]azelAzimuth/elevation angle {az,el} (rad)
[in]humiRelative humidity
Returns
Tropospheric delay (m)

Definition at line 162 of file mrtk_atmos.c.

References PI.

Referenced by corr_trop_distwgt(), corr_trop_plane(), decode_lcltrop(), encode_lcltrop(), model_trop(), trop_model_prec(), tropcorr(), zdres(), and zdres().

Here is the caller graph for this function: