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

MRTKLIB Geoid Module — Geoid height models. More...

#include "mrtklib/mrtk_geoid.h"
#include <math.h>
#include <stdint.h>
#include <stdio.h>
#include "mrtklib/mrtk_trace.h"
Include dependency graph for mrtk_geoid.c:

Go to the source code of this file.

Functions

static double interpb (const double *y, double a, double b)
static double geoidh_emb (const double *pos)
static int16_t fget2b (FILE *fp, int32_t off)
static double geoidh_egm96 (const double *pos)
static float fget4f (FILE *fp, int off)
static double geoidh_egm08 (const double *pos, int model)
static double fgetgsi (FILE *fp, int nlon, int nlat, int i, int j)
static double geoidh_gsi (const double *pos)
int opengeoid (int model, const char *file)
 Open geoid model file.
void closegeoid (void)
 Close geoid model file.
double geoidh (const double *pos)
 Get geoid height from geoid model.

Variables

static const double R2D = 180.0 / 3.1415926535897932
static const double range [4] = {0.00, 360.00, -90.00, 90.00}
static const float geoid [361][181]
static FILE * fp_geoid = NULL
static int model_geoid = GEOID_EMBEDDED

Detailed Description

MRTKLIB Geoid Module — Geoid height models.

reference : [1] EGM96 The NASA GSFC and NIMA Joint Geopotential Model [2] Earth Gravitational Model 2008 (EGM2008)

Definition in file mrtk_geoid.c.

Function Documentation

◆ closegeoid()

void closegeoid ( void )

Close geoid model file.

Definition at line 251 of file mrtk_geoid.c.

References fp_geoid, GEOID_EMBEDDED, model_geoid, and trace().

Referenced by closeses(), and opengeoid().

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

◆ fget2b()

int16_t fget2b ( FILE * fp,
int32_t off )
static

Definition at line 71 of file mrtk_geoid.c.

References trace().

Referenced by geoidh_egm96().

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

◆ fget4f()

float fget4f ( FILE * fp,
int off )
static

Definition at line 104 of file mrtk_geoid.c.

References trace().

Referenced by geoidh_egm08().

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

◆ fgetgsi()

double fgetgsi ( FILE * fp,
int nlon,
int nlat,
int i,
int j )
static

Definition at line 164 of file mrtk_geoid.c.

References trace().

Referenced by geoidh_gsi().

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

◆ geoidh()

double geoidh ( const double * pos)

Get geoid height from geoid model.

Parameters
[in]posGeodetic position {lat, lon} (rad)
Returns
Geoid height (m) (0.0: error)
Note
To use external geoid model, call opengeoid() before this function. If no external model is open, the embedded geoid model is used.

Definition at line 268 of file mrtk_geoid.c.

References GEOID_EGM2008_M10, GEOID_EGM2008_M25, GEOID_EGM96_M150, GEOID_EMBEDDED, GEOID_GSI2000_M15, geoidh_egm08(), geoidh_egm96(), geoidh_emb(), geoidh_gsi(), model_geoid, R2D, and trace().

Referenced by clas_osr_prectrop(), outnmea_gga(), outpos(), trop_data(), and tropmapf().

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

◆ geoidh_egm08()

double geoidh_egm08 ( const double * pos,
int model )
static

Definition at line 112 of file mrtk_geoid.c.

References fget4f(), fp_geoid, GEOID_EGM2008_M25, and interpb().

Referenced by geoidh().

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

◆ geoidh_egm96()

double geoidh_egm96 ( const double * pos)
static

Definition at line 79 of file mrtk_geoid.c.

References fget2b(), fp_geoid, and interpb().

Referenced by geoidh().

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

◆ geoidh_emb()

double geoidh_emb ( const double * pos)
static

Definition at line 47 of file mrtk_geoid.c.

References geoid, interpb(), range, and trace().

Referenced by geoidh().

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

◆ geoidh_gsi()

double geoidh_gsi ( const double * pos)
static

Definition at line 181 of file mrtk_geoid.c.

References fgetgsi(), fp_geoid, interpb(), and trace().

Referenced by geoidh().

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

◆ interpb()

double interpb ( const double * y,
double a,
double b )
static

Definition at line 43 of file mrtk_geoid.c.

Referenced by geoidh_egm08(), geoidh_egm96(), geoidh_emb(), and geoidh_gsi().

Here is the caller graph for this function:

◆ opengeoid()

int opengeoid ( int model,
const char * file )

Open geoid model file.

Parameters
[in]modelGeoid model type (GEOID_EMBEDDED, GEOID_EGM96_M150, etc.)
[in]fileGeoid model file path
Returns
Status (1:ok, 0:error)
Note
The following geoid models can be used:
  • WW15MGH.DAC: EGM96 15x15" binary grid height - Und_min2.5x2.5_egm2008_isw=82_WGS84_TideFree_SE: EGM2008 2.5x2.5"
  • Und_min1x1_egm2008_isw=82_WGS84_TideFree_SE: EGM2008 1.0x1.0" - gsigeome_ver4: GSI geoid 2000 1.0x1.5" (Japanese area) (byte-order of binary files must be compatible to CPU)

Definition at line 227 of file mrtk_geoid.c.

References closegeoid(), fp_geoid, GEOID_EGM2008_M10, GEOID_EGM2008_M25, GEOID_EGM96_M150, GEOID_EMBEDDED, GEOID_GSI2000_M15, model_geoid, and trace().

Referenced by openses().

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

Variable Documentation

◆ fp_geoid

FILE* fp_geoid = NULL
static

Definition at line 39 of file mrtk_geoid.c.

Referenced by closegeoid(), geoidh_egm08(), geoidh_egm96(), geoidh_gsi(), and opengeoid().

◆ geoid

const float geoid
static

Definition at line 38 of file mrtk_geoid.c.

Referenced by geoidh_emb().

◆ model_geoid

int model_geoid = GEOID_EMBEDDED
static

Definition at line 40 of file mrtk_geoid.c.

Referenced by closegeoid(), geoidh(), and opengeoid().

◆ R2D

const double R2D = 180.0 / 3.1415926535897932
static

Definition at line 33 of file mrtk_geoid.c.

◆ range

const double range = {0.00, 360.00, -90.00, 90.00}
static

Definition at line 37 of file mrtk_geoid.c.

Referenced by decode_bnx_7f_05_obs(), geoidh_emb(), getindex(), and nitem().