|
MRTKLIB 0.7.14
Modernized GNSS Positioning Library
|
MRTKLIB Precise Ephemeris Module — Earth rotation parameter I/O, precise ephemeris/clock computation, and satellite antenna offset functions. More...
#include "mrtklib/mrtk_peph.h"#include <stdio.h>#include <stdlib.h>#include "mrtklib/mrtk_antenna.h"#include "mrtklib/mrtk_astro.h"#include "mrtklib/mrtk_mat.h"#include "mrtklib/mrtk_nav.h"#include "mrtklib/mrtk_sys.h"#include <math.h>#include <string.h>#include "mrtklib/mrtk_trace.h"Go to the source code of this file.
Macros | |
| #define | PI 3.1415926535897932 /* pi */ |
| #define | D2R (PI / 180.0) /* deg to rad */ |
| #define | AS2R (D2R / 3600.0) /* arc sec to radian */ |
| #define | CLIGHT 299792458.0 /* speed of light (m/s) */ |
| #define | OMGE 7.2921151467E-5 /* earth angular velocity (IS-GPS) (rad/s) */ |
| #define | SQR(x) |
| #define | SYS_NONE 0x00 |
| #define | SYS_GPS 0x01 |
| #define | SYS_SBS 0x02 |
| #define | SYS_GLO 0x04 |
| #define | SYS_GAL 0x08 |
| #define | SYS_QZS 0x10 |
| #define | SYS_CMP 0x20 |
| #define | SYS_IRN 0x40 |
| #define | SYS_LEO 0x80 |
| #define | FREQ1 1.57542E9 /* L1/E1/B1C frequency (Hz) */ |
| #define | FREQ2 1.22760E9 /* L2 frequency (Hz) */ |
| #define | FREQ5 1.17645E9 /* L5/E5a/B2a frequency (Hz) */ |
| #define | FREQ7 1.20714E9 /* E5b frequency (Hz) */ |
| #define | FREQ9 2.492028E9 /* S frequency (Hz) */ |
| #define | FREQ1_CMP 1.561098E9 /* BDS B1I frequency (Hz) */ |
| #define | FREQ2_CMP 1.20714E9 /* BDS B2I/B2b frequency (Hz) */ |
| #define | NMAX 10 /* order of polynomial interpolation */ |
| #define | MAXDTE 900.0 /* max time difference to ephem time (s) */ |
| #define | EXTERR_CLK 1E-3 /* extrapolation error for clock (m/s) */ |
| #define | EXTERR_EPH 5E-7 /* extrapolation error for ephem (m/s^2) */ |
Functions | |
| int | satsys_bd2 (int sat, int *prn) |
| int | freq_idx2freq_num (int sys, int freq_idx) |
| double | freq_num2freq (int sys, int freq_num, int fcn) |
| int | freq_idx2ant_idx (int sys, int freq_idx) |
| int | readerp (const char *file, erp_t *erp) |
| Read earth rotation parameters from IGS ERP file (ver.2). | |
| int | geterp (const erp_t *erp, gtime_t time, double *erpv) |
| Get earth rotation parameter values at specified time. | |
| static int | code2sys (char code) |
| static int | readsp3h (FILE *fp, gtime_t *time, char *type, int *sats, double *bfact, char *tsys) |
| static int | addpeph (nav_t *nav, peph_t *peph) |
| static void | readsp3b (FILE *fp, char type, int *sats, int ns, double *bfact, char *tsys, int index, int opt, nav_t *nav) |
| static int | cmppeph (const void *p1, const void *p2) |
| static void | combpeph (nav_t *nav, int opt) |
| void | readsp3 (const char *file, nav_t *nav, int opt) |
| Read sp3 precise ephemeris file. | |
| int | readsap (const char *file, gtime_t time, nav_t *nav) |
| Read satellite antenna parameters. | |
| static int | readdcbf (const char *file, nav_t *nav, const sta_t *sta) |
| int | readdcb (const char *file, nav_t *nav, const sta_t *sta) |
| Read differential code bias (DCB) parameters. | |
| static double | interppol (const double *x, double *y, int n) |
| static int | pephpos (gtime_t time, int sat, const nav_t *nav, double *rs, double *dts, double *vare, double *varc) |
| static int | pephclk (gtime_t time, int sat, const nav_t *nav, double *dts, double *varc) |
| void | satantoff (gtime_t time, const double *rs, int sat, const nav_t *nav, double *dant) |
| Compute satellite antenna phase center offset in ecef. | |
| int | peph2pos (gtime_t time, int sat, const nav_t *nav, int opt, double *rs, double *dts, double *var) |
| Compute satellite position/clock with precise ephemeris/clock. | |
MRTKLIB Precise Ephemeris Module — Earth rotation parameter I/O, precise ephemeris/clock computation, and satellite antenna offset functions.
This file contains the ERP functions extracted from rtkcmn.c, plus all precise ephemeris functions absorbed from preceph.c with zero algorithmic changes (pure cut-and-paste).
Definition in file mrtk_peph.c.
| #define AS2R (D2R / 3600.0) /* arc sec to radian */ |
Definition at line 53 of file mrtk_peph.c.
| #define CLIGHT 299792458.0 /* speed of light (m/s) */ |
Definition at line 54 of file mrtk_peph.c.
| #define D2R (PI / 180.0) /* deg to rad */ |
Definition at line 52 of file mrtk_peph.c.
| #define EXTERR_CLK 1E-3 /* extrapolation error for clock (m/s) */ |
Definition at line 82 of file mrtk_peph.c.
| #define EXTERR_EPH 5E-7 /* extrapolation error for ephem (m/s^2) */ |
Definition at line 83 of file mrtk_peph.c.
Referenced by pephpos().
| #define FREQ1 1.57542E9 /* L1/E1/B1C frequency (Hz) */ |
Definition at line 71 of file mrtk_peph.c.
| #define FREQ1_CMP 1.561098E9 /* BDS B1I frequency (Hz) */ |
Definition at line 76 of file mrtk_peph.c.
| #define FREQ2 1.22760E9 /* L2 frequency (Hz) */ |
Definition at line 72 of file mrtk_peph.c.
| #define FREQ2_CMP 1.20714E9 /* BDS B2I/B2b frequency (Hz) */ |
Definition at line 77 of file mrtk_peph.c.
| #define FREQ5 1.17645E9 /* L5/E5a/B2a frequency (Hz) */ |
Definition at line 73 of file mrtk_peph.c.
| #define FREQ7 1.20714E9 /* E5b frequency (Hz) */ |
Definition at line 74 of file mrtk_peph.c.
| #define FREQ9 2.492028E9 /* S frequency (Hz) */ |
Definition at line 75 of file mrtk_peph.c.
| #define MAXDTE 900.0 /* max time difference to ephem time (s) */ |
Definition at line 81 of file mrtk_peph.c.
| #define NMAX 10 /* order of polynomial interpolation */ |
Definition at line 80 of file mrtk_peph.c.
Referenced by pephpos().
| #define OMGE 7.2921151467E-5 /* earth angular velocity (IS-GPS) (rad/s) */ |
Definition at line 55 of file mrtk_peph.c.
| #define PI 3.1415926535897932 /* pi */ |
Definition at line 51 of file mrtk_peph.c.
| #define SQR | ( | x | ) |
Definition at line 57 of file mrtk_peph.c.
Referenced by pephclk(), pephpos(), and satantoff().
| #define SYS_CMP 0x20 |
Definition at line 66 of file mrtk_peph.c.
| #define SYS_GAL 0x08 |
Definition at line 64 of file mrtk_peph.c.
| #define SYS_GLO 0x04 |
Definition at line 63 of file mrtk_peph.c.
| #define SYS_GPS 0x01 |
Definition at line 61 of file mrtk_peph.c.
| #define SYS_IRN 0x40 |
Definition at line 67 of file mrtk_peph.c.
| #define SYS_LEO 0x80 |
Definition at line 68 of file mrtk_peph.c.
| #define SYS_NONE 0x00 |
Definition at line 60 of file mrtk_peph.c.
| #define SYS_QZS 0x10 |
Definition at line 65 of file mrtk_peph.c.
| #define SYS_SBS 0x02 |
Definition at line 62 of file mrtk_peph.c.
Definition at line 272 of file mrtk_peph.c.
References free, nav_s::ne, nav_s::nemax, nav_s::peph, and trace().
Referenced by readsp3b().
|
static |
Definition at line 392 of file mrtk_peph.c.
References peph_t::index, gtime_t::time, peph_t::time, and timediff().
Referenced by combpeph().
|
static |
Definition at line 201 of file mrtk_peph.c.
References SYS_CMP, SYS_GAL, SYS_GLO, SYS_GPS, SYS_IRN, SYS_LEO, SYS_NONE, and SYS_QZS.
Referenced by readsp3b(), and readsp3h().
|
static |
Definition at line 398 of file mrtk_peph.c.
References cmppeph(), MAXSAT, nav_s::ne, norm(), nav_s::peph, peph_t::pos, peph_t::std, peph_t::time, timediff(), trace(), peph_t::vel, and peph_t::vst.
Referenced by readsp3().
|
extern |
Definition at line 743 of file mrtk_nav.c.
Referenced by satantoff().
|
extern |
Definition at line 649 of file mrtk_nav.c.
Referenced by satantoff().
|
extern |
Definition at line 680 of file mrtk_nav.c.
Referenced by satantoff().
Get earth rotation parameter values at specified time.
| [in] | erp | Earth rotation parameters |
| [in] | time | Time (GPST) |
| [out] | erpv | ERP values {xp,yp,ut1_utc,lod} (rad,rad,s,s/d) |
Definition at line 146 of file mrtk_peph.c.
References erp_t::data, epoch2time(), gpst2utc(), erpd_t::lod, erpd_t::mjd, erp_t::n, timediff(), trace(), erpd_t::ut1_utc, erpd_t::xp, erpd_t::xpr, erpd_t::yp, and erpd_t::ypr.
Referenced by clas_osr_zdres(), and tidedisp().
|
static |
Definition at line 614 of file mrtk_peph.c.
Referenced by pephpos().
|
extern |
Compute satellite position/clock with precise ephemeris/clock.
| [in] | time | Time (GPST) |
| [in] | sat | Satellite number |
| [in] | nav | Navigation data |
| [in] | opt | Sat position option (0:center of mass, 1:antenna phase center) |
| [out] | rs | Sat position and velocity (ecef) {x,y,z,vx,vy,vz} (m|m/s) |
| [out] | dts | Sat clock {bias,drift} (s|s/s) |
| [out] | var | Sat position and clock error variance (m^2) (NULL: no output) |
Definition at line 864 of file mrtk_peph.c.
References CLIGHT, dot(), MAXSAT, pephclk(), pephpos(), satantoff(), time_str(), timeadd(), and trace().
Referenced by satpos().
Definition at line 717 of file mrtk_peph.c.
References CLIGHT, pclk_t::clk, EXTERR_CLK, MAXDTE, nav_s::nc, nav_s::pclk, SQR, pclk_t::std, pclk_t::time, time_str(), timediff(), and trace().
Referenced by peph2pos().
|
static |
Definition at line 625 of file mrtk_peph.c.
References CLIGHT, EXTERR_CLK, EXTERR_EPH, interppol(), MAXDTE, nav_s::ne, NMAX, norm(), OMGE, nav_s::peph, peph_t::pos, SQR, peph_t::std, peph_t::time, time_str(), timediff(), and trace().
Referenced by peph2pos().
Read differential code bias (DCB) parameters.
| [in] | file | DCB parameters file (wild-card * expanded) |
| [in,out] | nav | Navigation data |
| [in] | sta | Station info data to import receiver DCB (NULL: no use) |
Definition at line 583 of file mrtk_peph.c.
References nav_s::cbias, expath(), free, malloc, MAXEXFILE, MAXSAT, readdcbf(), and trace().
Referenced by execses().
Definition at line 527 of file mrtk_peph.c.
References nav_s::cbias, CLIGHT, MAXRCV, nav_s::rbias, satid2no(), str2num(), and trace().
Referenced by readdcb().
|
extern |
Read earth rotation parameters from IGS ERP file (ver.2).
| [in] | file | IGS ERP file path |
| [out] | erp | Earth rotation parameters |
Definition at line 99 of file mrtk_peph.c.
References AS2R, erp_t::data, free, erpd_t::lod, erpd_t::mjd, erp_t::n, erp_t::nmax, trace(), erpd_t::ut1_utc, erpd_t::xp, erpd_t::xpr, erpd_t::yp, and erpd_t::ypr.
Referenced by execses().
Read satellite antenna parameters.
| [in] | file | Antenna parameter file |
| [in] | time | Time (GPST) |
| [in,out] | nav | Navigation data |
Definition at line 508 of file mrtk_peph.c.
References free, MAXSAT, pcvs_t::pcv, nav_s::pcvs, readpcv(), searchpcv(), time_str(), and trace().
|
extern |
Read sp3 precise ephemeris file.
| [in] | file | SP3 precise ephemeris file (wild-card * expanded) |
| [in,out] | nav | Navigation data |
| [in] | opt | Options (1:only observed + 2:only predicted + 4:not combined) |
Definition at line 450 of file mrtk_peph.c.
References combpeph(), expath(), free, malloc, MAXEXFILE, MAXSAT, nav_s::ne, readsp3b(), readsp3h(), and trace().
Referenced by decodefile(), and readpreceph().
|
static |
Definition at line 290 of file mrtk_peph.c.
References addpeph(), code2sys(), peph_t::cov, peph_t::index, MAXSAT, peph_t::pos, satno(), peph_t::std, str2num(), str2time(), SYS_GPS, SYS_QZS, SYS_SBS, peph_t::time, trace(), utc2gpst(), peph_t::vco, peph_t::vel, and peph_t::vst.
Referenced by readsp3().
|
static |
Definition at line 226 of file mrtk_peph.c.
References code2sys(), MAXSAT, satno(), str2num(), str2time(), and trace().
Referenced by readsp3().
|
extern |
Compute satellite antenna phase center offset in ecef.
| [in] | time | Time (GPST) |
| [in] | rs | Satellite position and velocity (ecef) {x,y,z,vx,vy,vz} (m|m/s) |
| [in] | sat | Satellite number |
| [in] | nav | Navigation data |
| [out] | dant | Satellite antenna phase center offset (ecef) {dx,dy,dz} (m) |
Definition at line 785 of file mrtk_peph.c.
References CODE_L1C, CODE_L2C, cross3(), freq_idx2ant_idx(), freq_idx2freq_num(), freq_num2freq(), gpst2utc(), normv3(), pcv_t::off, nav_s::pcvs, sat2freq(), satsys_bd2(), SQR, sunmoonpos(), SYS_GLO, time_str(), and trace().
Referenced by peph2pos(), and satpos_ssr().
|
extern |
Definition at line 159 of file mrtk_nav.c.
Referenced by satantoff().