MRTKLIB 0.7.14
Modernized GNSS Positioning Library
Loading...
Searching...
No Matches
mrtk_eph.h File Reference

MRTKLIB Broadcast Ephemeris Module — Satellite orbit/clock types and Kepler/GLONASS/SBAS orbit computation functions. More...

Include dependency graph for mrtk_eph.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  alm_t
 GPS/GAL/QZS/BDS/IRN almanac type. More...
struct  galm_t
 GLONASS almanac type. More...
struct  eph_t
 GPS/GAL/QZS/BDS/IRN broadcast ephemeris type. More...
struct  geph_t
 GLONASS broadcast ephemeris type. More...
struct  seph_t
 SBAS ephemeris type. More...

Typedefs

typedef struct nav_s nav_t

Functions

double eph2clk (gtime_t time, const eph_t *eph)
 Compute satellite clock bias with broadcast ephemeris (GPS/GAL/QZS).
void eph2pos (gtime_t time, const eph_t *eph, double *rs, double *dts, double *var)
 Compute satellite position and clock with broadcast ephemeris (GPS/GAL/QZS/BDS/IRN).
double geph2clk (gtime_t time, const geph_t *geph)
 Compute satellite clock bias with GLONASS ephemeris.
void geph2pos (gtime_t time, const geph_t *geph, double *rs, double *dts, double *var)
 Compute satellite position and clock with GLONASS ephemeris.
double seph2clk (gtime_t time, const seph_t *seph)
 Compute satellite clock bias with SBAS ephemeris.
void seph2pos (gtime_t time, const seph_t *seph, double *rs, double *dts, double *var)
 Compute satellite position and clock with SBAS ephemeris.
void alm2pos (gtime_t time, const alm_t *alm, double *rs, double *dts)
 Compute satellite position and clock bias with almanac.
void setseleph (int sys, int sel)
 Set selected satellite ephemeris for multiple ones.
int getseleph (int sys)
 Get selected satellite ephemeris.
void set_ssr_ch_idx (int ch)
 Set SSR channel index for satpos_ssr() (multi-L6E).
int get_ssr_ch_idx (void)
 Get current SSR channel index.
eph_t * seleph (gtime_t time, int sat, int iode, const nav_t *nav)
 Select broadcast ephemeris by satellite and IODE.
int ephpos (gtime_t time, gtime_t teph, int sat, const nav_t *nav, int iode, double *rs, double *dts, double *var, int *svh)
 Satellite position and clock by broadcast ephemeris.

Detailed Description

MRTKLIB Broadcast Ephemeris Module — Satellite orbit/clock types and Kepler/GLONASS/SBAS orbit computation functions.

This header provides the fundamental broadcast ephemeris struct types (eph_t, geph_t, seph_t, alm_t, galm_t) and the pure orbit/clock computation functions extracted from ephemeris.c.

Note
All functions in this module are pure cut-and-paste extractions from ephemeris.c with zero algorithmic changes.

Definition in file mrtk_eph.h.

Typedef Documentation

◆ nav_t

typedef struct nav_s nav_t

Definition at line 40 of file mrtk_eph.h.

Function Documentation

◆ alm2pos()

void alm2pos ( gtime_t time,
const alm_t * alm,
double * rs,
double * dts )

Compute satellite position and clock bias with almanac.

Parameters
[in]timeTime (GPST)
[in]almAlmanac
[out]rsSatellite position (ecef) {x,y,z} (m)
[out]dtsSatellite clock bias (s)

Definition at line 185 of file mrtk_eph.c.

References alm_t::A, alm_t::e, alm_t::f0, alm_t::f1, alm_t::i0, alm_t::M0, MAX_ITER_KEPLER, MU_GAL, MU_GPS, alm_t::omg, alm_t::OMG0, alm_t::OMGd, OMGE, RTOL_KEPLER, alm_t::sat, satsys(), SYS_GAL, time_str(), timediff(), alm_t::toa, alm_t::toas, and trace().

Here is the call graph for this function:

◆ eph2clk()

double eph2clk ( gtime_t time,
const eph_t * eph )

Compute satellite clock bias with broadcast ephemeris (GPS/GAL/QZS).

Parameters
[in]timeTime by satellite clock (GPST)
[in]ephBroadcast ephemeris
Returns
Satellite clock bias (s) without relativity correction

Definition at line 232 of file mrtk_eph.c.

References eph_t::f0, eph_t::f1, eph_t::f2, eph_t::sat, time_str(), timediff(), eph_t::toc, and trace().

Referenced by clas_osr_adjust_r_dts(), and ephclk().

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

◆ eph2pos()

void eph2pos ( gtime_t time,
const eph_t * eph,
double * rs,
double * dts,
double * var )

Compute satellite position and clock with broadcast ephemeris (GPS/GAL/QZS/BDS/IRN).

Parameters
[in]timeTime (GPST)
[in]ephBroadcast ephemeris
[out]rsSatellite position (ecef) {x,y,z} (m)
[out]dtsSatellite clock bias (s)
[out]varSatellite position and clock variance (m^2)

Definition at line 258 of file mrtk_eph.c.

References eph_t::A, eph_t::cic, eph_t::cis, CLIGHT, COS_5, eph_t::crc, eph_t::crs, eph_t::cuc, eph_t::cus, eph_t::deln, eph_t::e, eph_t::f0, eph_t::f1, eph_t::f2, eph_t::i0, eph_t::idot, eph_t::M0, MAX_ITER_KEPLER, MU_CMP, MU_GAL, MU_GPS, eph_t::omg, eph_t::OMG0, eph_t::OMGd, OMGE, OMGE_CMP, OMGE_GAL, RTOL_KEPLER, eph_t::sat, satsys(), SIN_5, SQR, eph_t::sva, SYS_CMP, SYS_GAL, time_str(), timediff(), eph_t::toc, eph_t::toe, eph_t::toes, trace(), and var_uraeph().

Referenced by ephpos().

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

◆ ephpos()

int ephpos ( gtime_t time,
gtime_t teph,
int sat,
const nav_t * nav,
int iode,
double * rs,
double * dts,
double * var,
int * svh )

Satellite position and clock by broadcast ephemeris.

Parameters
[in]timeTransmission time
[in]tephTime for ephemeris selection
[in]satSatellite number
[in]navNavigation data
[in]iodeIODE (-1: any)
[out]rsSatellite position/velocity {x,y,z,vx,vy,vz} (m,m/s)
[out]dtsSatellite clock {bias,drift} (s,s/s)
[out]varSatellite position variance (m^2)
[out]svhSatellite health flag
Returns
1:ok, 0:error

Definition at line 673 of file mrtk_eph.c.

References eph2pos(), geph2pos(), satsys(), seleph(), selgeph(), selseph(), seph2pos(), eph_t::svh, geph_t::svh, seph_t::svh, SYS_CMP, SYS_GAL, SYS_GLO, SYS_GPS, SYS_IRN, SYS_QZS, SYS_SBS, geph_t::taun, time_str(), timeadd(), and trace().

Referenced by clas_osr_adjust_r_dts(), clas_osr_satcorr_update(), satpos(), satpos_sbas(), and satpos_ssr().

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

◆ geph2clk()

double geph2clk ( gtime_t time,
const geph_t * geph )

Compute satellite clock bias with GLONASS ephemeris.

Parameters
[in]timeTime by satellite clock (GPST)
[in]gephGLONASS ephemeris
Returns
Satellite clock bias (s)

Definition at line 349 of file mrtk_eph.c.

References geph_t::gamn, geph_t::sat, geph_t::taun, time_str(), timediff(), geph_t::toe, and trace().

Referenced by ephclk().

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

◆ geph2pos()

void geph2pos ( gtime_t time,
const geph_t * geph,
double * rs,
double * dts,
double * var )

Compute satellite position and clock with GLONASS ephemeris.

Parameters
[in]timeTime (GPST)
[in]gephGLONASS ephemeris
[out]rsSatellite position {x,y,z} (ecef) (m)
[out]dtsSatellite clock bias (s)
[out]varSatellite position and clock variance (m^2)

Definition at line 372 of file mrtk_eph.c.

References geph_t::acc, ERREPH_GLO, geph_t::gamn, glorbit(), geph_t::pos, geph_t::sat, SQR, geph_t::taun, time_str(), timediff(), geph_t::toe, trace(), TSTEP, and geph_t::vel.

Referenced by ephpos().

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

◆ get_ssr_ch_idx()

int get_ssr_ch_idx ( void )

Get current SSR channel index.

Returns
Current channel index

Definition at line 766 of file mrtk_eph.c.

References _ssr_ch_idx.

◆ getseleph()

int getseleph ( int sys)

Get selected satellite ephemeris.

Parameters
[in]sysSatellite system (SYS_???)
Returns
Selected ephemeris (refer setseleph())

Definition at line 1040 of file mrtk_eph.c.

References eph_sel, SYS_CMP, SYS_GAL, SYS_GLO, SYS_GPS, SYS_IRN, SYS_QZS, and SYS_SBS.

Referenced by prange(), and seleph().

Here is the caller graph for this function:

◆ seleph()

eph_t * seleph ( gtime_t time,
int sat,
int iode,
const nav_t * nav )

Select broadcast ephemeris by satellite and IODE.

Parameters
[in]timeTime for ephemeris selection
[in]satSatellite number
[in]iodeIODE (-1: any)
[in]navNavigation data
Returns
Pointer to selected ephemeris, NULL if not found

Definition at line 465 of file mrtk_eph.c.

References eph_t::code, nav_s::eph, nav_s::eph_prev, eph_sel, getseleph(), eph_t::iode, MAXDTOE, MAXDTOE_CMP, MAXDTOE_GAL, MAXDTOE_IRN, MAXDTOE_QZS, MAXSAT, nav_s::n, eph_t::sat, satsys(), SYS_CMP, SYS_GAL, SYS_GPS, SYS_IRN, SYS_QZS, time_str(), timediff(), eph_t::toe, eph_t::toes, and trace().

Referenced by clas_osr_adjust_r_dts(), ephclk(), ephpos(), and satpos_ssr().

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

◆ seph2clk()

double seph2clk ( gtime_t time,
const seph_t * seph )

Compute satellite clock bias with SBAS ephemeris.

Parameters
[in]timeTime by satellite clock (GPST)
[in]sephSBAS ephemeris
Returns
Satellite clock bias (s)

Definition at line 405 of file mrtk_eph.c.

References seph_t::af0, seph_t::af1, seph_t::sat, seph_t::t0, time_str(), timediff(), and trace().

Referenced by ephclk().

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

◆ seph2pos()

void seph2pos ( gtime_t time,
const seph_t * seph,
double * rs,
double * dts,
double * var )

Compute satellite position and clock with SBAS ephemeris.

Parameters
[in]timeTime (GPST)
[in]sephSBAS ephemeris
[out]rsSatellite position {x,y,z} (ecef) (m)
[out]dtsSatellite clock bias (s)
[out]varSatellite position and clock variance (m^2)

Definition at line 428 of file mrtk_eph.c.

References seph_t::acc, seph_t::af0, seph_t::af1, seph_t::pos, seph_t::sat, seph_t::sva, SYS_SBS, seph_t::t0, time_str(), timediff(), trace(), var_uraeph(), and seph_t::vel.

Referenced by ephpos().

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

◆ set_ssr_ch_idx()

void set_ssr_ch_idx ( int ch)

Set SSR channel index for satpos_ssr() (multi-L6E).

Parameters
[in]chChannel index (0 or 1)

Definition at line 761 of file mrtk_eph.c.

References _ssr_ch_idx, and SSR_CH_NUM.

Referenced by clas_ssr2osr(), and ppp_rtk_pos().

Here is the caller graph for this function:

◆ setseleph()

void setseleph ( int sys,
int sel )

Set selected satellite ephemeris for multiple ones.

Parameters
[in]sysSatellite system (SYS_???)
[in]selSelection of ephemeris GPS,QZS : 0:LNAV ,1:CNAV (default: LNAV) GAL : 0:I/NAV,1:F/NAV (default: I/NAV) others : undefined

Definition at line 1009 of file mrtk_eph.c.

References eph_sel, SYS_CMP, SYS_GAL, SYS_GLO, SYS_GPS, SYS_IRN, SYS_QZS, and SYS_SBS.