MRTKLIB 0.7.14
Modernized GNSS Positioning Library
Loading...
Searching...
No Matches
mrtk_ionex.c File Reference
#include "mrtklib/mrtk_ionex.h"
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include "mrtklib/mrtk_atmos.h"
#include "mrtklib/mrtk_sys.h"
#include "mrtklib/mrtk_trace.h"
Include dependency graph for mrtk_ionex.c:

Go to the source code of this file.

Macros

#define SQR(x)
#define VAR_NOTEC   SQR(30.0) /* variance of no tec */
#define MIN_EL   0.0 /* min elevation angle (rad) */
#define MIN_HGT   -1000.0 /* min user height (m) */

Functions

static int getindex (double value, const double *range)
static int nitem (const double *range)
static int dataindex (int i, int j, int k, const int *ndata)
static tec_t * addtec (const double *lats, const double *lons, const double *hgts, double rb, nav_t *nav)
static void readionexdcb (FILE *fp, double *dcb, double *rms)
static double readionexh (FILE *fp, double *lats, double *lons, double *hgts, double *rb, double *nexp, double *dcb, double *rms)
static int readionexb (FILE *fp, const double *lats, const double *lons, const double *hgts, double rb, double nexp, nav_t *nav)
static void combtec (nav_t *nav)
void readtec (const char *file, nav_t *nav, int opt)
 Read IONEX ionospheric TEC grid file.
static int interptec (const tec_t *tec, int k, const double *posp, double *value, double *rms)
static int iondelay (gtime_t time, const tec_t *tec, const double *pos, const double *azel, int opt, double *delay, double *var)
int iontec (gtime_t time, const nav_t *nav, const double *pos, const double *azel, int opt, double *delay, double *var)
 Compute ionospheric delay by TEC grid data.

Variables

static const double PI = 3.1415926535897932
static const double R2D = 180.0 / 3.1415926535897932
static const double CLIGHT = 299792458.0
static const double FREQ1 = 1.57542E9

Macro Definition Documentation

◆ MIN_EL

#define MIN_EL   0.0 /* min elevation angle (rad) */

Definition at line 34 of file mrtk_ionex.c.

Referenced by iontec(), and varerr().

◆ MIN_HGT

#define MIN_HGT   -1000.0 /* min user height (m) */

Definition at line 35 of file mrtk_ionex.c.

Referenced by iontec().

◆ SQR

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

Definition at line 32 of file mrtk_ionex.c.

◆ VAR_NOTEC

#define VAR_NOTEC   SQR(30.0) /* variance of no tec */

Definition at line 33 of file mrtk_ionex.c.

Referenced by iontec().

Function Documentation

◆ addtec()

tec_t * addtec ( const double * lats,
const double * lons,
const double * hgts,
double rb,
nav_t * nav )
static

Definition at line 62 of file mrtk_ionex.c.

References tec_t::data, free, tec_t::hgts, tec_t::lats, tec_t::lons, malloc, tec_t::ndata, nitem(), nav_s::nt, nav_s::ntmax, tec_t::rb, tec_t::rms, nav_s::tec, tec_t::time, and trace().

Referenced by readionexb().

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

◆ combtec()

void combtec ( nav_t * nav)
static

Definition at line 263 of file mrtk_ionex.c.

References tec_t::data, free, nav_s::nt, tec_t::rms, nav_s::tec, tec_t::time, timediff(), and trace().

Referenced by readtec().

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

◆ dataindex()

int dataindex ( int i,
int j,
int k,
const int * ndata )
static

Definition at line 55 of file mrtk_ionex.c.

Referenced by interptec(), and readionexb().

Here is the caller graph for this function:

◆ getindex()

int getindex ( double value,
const double * range )
static

Definition at line 40 of file mrtk_ionex.c.

References range.

Referenced by nitem(), and readionexb().

Here is the caller graph for this function:

◆ interptec()

int interptec ( const tec_t * tec,
int k,
const double * posp,
double * value,
double * rms )
static

Definition at line 357 of file mrtk_ionex.c.

References tec_t::data, dataindex(), tec_t::lats, tec_t::lons, tec_t::ndata, R2D, tec_t::rms, and trace().

Referenced by iondelay().

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

◆ iondelay()

int iondelay ( gtime_t time,
const tec_t * tec,
const double * pos,
const double * azel,
int opt,
double * delay,
double * var )
static

Definition at line 427 of file mrtk_ionex.c.

References FREQ1, tec_t::hgts, interptec(), ionppp(), tec_t::ndata, PI, R2D, tec_t::rb, tec_t::time, time_str(), timediff(), and trace().

Referenced by iontec().

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

◆ iontec()

int iontec ( gtime_t time,
const nav_t * nav,
const double * pos,
const double * azel,
int opt,
double * delay,
double * var )

Compute ionospheric delay by TEC grid data.

Parameters
[in]timeTime (GPST)
[in]navNavigation data (with TEC grid)
[in]posReceiver position {lat,lon,h} (rad,m)
[in]azelAzimuth/elevation angle {az,el} (rad)
[in]optModel option (bit 0: 0=E-layer, 1=F2-layer; bit 1: 0=single-layer, 1=modified single-layer)
[out]delayIonospheric delay (L1) (m)
[out]varIonospheric delay variance (L1) (m^2)
Returns
Status (1:ok, 0:error)

Definition at line 481 of file mrtk_ionex.c.

References iondelay(), MIN_EL, MIN_HGT, nav_s::nt, R2D, nav_s::tec, tec_t::time, time_str(), timediff(), trace(), and VAR_NOTEC.

Referenced by ionocorr(), and model_iono().

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

◆ nitem()

int nitem ( const double * range)
static

Definition at line 53 of file mrtk_ionex.c.

References getindex(), and range.

Referenced by addtec(), readionexb(), toml_array_at(), toml_raw_at(), and toml_table_at().

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

◆ readionexb()

int readionexb ( FILE * fp,
const double * lats,
const double * lons,
const double * hgts,
double rb,
double nexp,
nav_t * nav )
static

Definition at line 183 of file mrtk_ionex.c.

References addtec(), tec_t::data, dataindex(), getindex(), tec_t::hgts, tec_t::lats, tec_t::lons, tec_t::ndata, nitem(), nav_s::nt, tec_t::rms, str2num(), str2time(), nav_s::tec, tec_t::time, timediff(), and trace().

Referenced by readtec().

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

◆ readionexdcb()

void readionexdcb ( FILE * fp,
double * dcb,
double * rms )
static

Definition at line 109 of file mrtk_ionex.c.

References MAXSAT, satid2no(), str2num(), and trace().

Referenced by readionexh().

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

◆ readionexh()

double readionexh ( FILE * fp,
double * lats,
double * lons,
double * hgts,
double * rb,
double * nexp,
double * dcb,
double * rms )
static

Definition at line 141 of file mrtk_ionex.c.

References readionexdcb(), str2num(), and trace().

Referenced by readtec().

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

◆ readtec()

void readtec ( const char * file,
nav_t * nav,
int opt )

Read IONEX ionospheric TEC grid file.

Parameters
[in]fileIONEX TEC grid file path (wild-card * expanded)
[in,out]navNavigation data (tec grid data appended)
[in]optRead option (1: no clear of old TEC data, 0: clear)

Definition at line 301 of file mrtk_ionex.c.

References nav_s::cbias, CLIGHT, combtec(), expath(), free, malloc, MAXEXFILE, MAXSAT, nav_s::nt, nav_s::ntmax, readionexb(), readionexh(), nav_s::tec, and trace().

Referenced by execses().

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

Variable Documentation

◆ CLIGHT

const double CLIGHT = 299792458.0
static

Definition at line 29 of file mrtk_ionex.c.

◆ FREQ1

const double FREQ1 = 1.57542E9
static

Definition at line 30 of file mrtk_ionex.c.

◆ PI

const double PI = 3.1415926535897932
static

Definition at line 27 of file mrtk_ionex.c.

◆ R2D

const double R2D = 180.0 / 3.1415926535897932
static

Definition at line 28 of file mrtk_ionex.c.