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

MRTKLIB Astronomy Module — Implementation. More...

#include "mrtklib/mrtk_astro.h"
#include <math.h>
#include "mrtklib/mrtk_coords.h"
#include "mrtklib/mrtk_mat.h"
#include "mrtklib/mrtk_trace.h"
Include dependency graph for mrtk_astro.c:

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 AU   149597870691.0 /* 1 AU (m) */
#define RE_WGS84   6378137.0 /* earth semimajor axis (WGS84) (m) */

Functions

static void ast_args (double t, double *f)
void sunmoonpos_eci (gtime_t tut, double *rsun, double *rmoon)
 Compute sun and moon position in ECI.
void sunmoonpos (gtime_t tutc, const double *erpv, double *rsun, double *rmoon, double *gmst)
 Compute sun and moon position in ECEF.

Detailed Description

MRTKLIB Astronomy Module — Implementation.

All functions and static data in this file are cut-and-paste extractions from the legacy rtkcmn.c with zero algorithmic changes.

Definition in file mrtk_astro.c.

Macro Definition Documentation

◆ AS2R

#define AS2R   (D2R / 3600.0) /* arc sec to radian */

Definition at line 42 of file mrtk_astro.c.

◆ AU

#define AU   149597870691.0 /* 1 AU (m) */

Definition at line 43 of file mrtk_astro.c.

Referenced by sunmoonpos_eci().

◆ D2R

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

Definition at line 41 of file mrtk_astro.c.

◆ PI

#define PI   3.1415926535897932 /* pi */

Definition at line 40 of file mrtk_astro.c.

◆ RE_WGS84

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

Definition at line 44 of file mrtk_astro.c.

Function Documentation

◆ ast_args()

void ast_args ( double t,
double * f )
static

Definition at line 51 of file mrtk_astro.c.

References AS2R, and PI.

Referenced by sunmoonpos_eci().

Here is the caller graph for this function:

◆ sunmoonpos()

void sunmoonpos ( gtime_t tutc,
const double * erpv,
double * rsun,
double * rmoon,
double * gmst )
extern

Compute sun and moon position in ECEF.

Parameters
[in]tutcTime in UTC (GPST)
[in]erpvERP value {xp,yp,ut1_utc,lod} (rad,rad,s,s/d)
[out]rsunSun position in ECEF (m) (NULL: not output)
[out]rmoonMoon position in ECEF (m) (NULL: not output)
[out]gmstGMST (rad) (NULL: not output)

Definition at line 135 of file mrtk_astro.c.

References eci2ecef(), matmul(), sunmoonpos_eci(), time_str(), timeadd(), and trace().

Referenced by sat_yaw(), satantoff(), testeclipse(), tidedisp(), and windupcorr().

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

◆ sunmoonpos_eci()

void sunmoonpos_eci ( gtime_t tut,
double * rsun,
double * rmoon )
extern

Compute sun and moon position in ECI.

Parameters
[in]tutTime in UT1 (GPST)
[out]rsunSun position in ECI (m) (NULL: not output)
[out]rmoonMoon position in ECI (m) (NULL: not output)
Note
See reference [4] 5.1.1, 5.2.1

Definition at line 78 of file mrtk_astro.c.

References ast_args(), AU, D2R, epoch2time(), RE_WGS84, time_str(), timediff(), and trace().

Referenced by sunmoonpos().

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