Generic timing routines.
More...
#include "CUtils.h"
#include "LeapSeconds.h"
Go to the source code of this file.
|
#define | EPOCH_GPS_TAI_UTC 19 |
| Leap seconds (TAI-UTC) on the GPS epoch (1980 JAN 6 0h UTC) */.
|
|
#define | EPOCH_J2000_0_JD 2451545.0 |
| Julian Day of the J2000.0 epoch (2000 JAN 1 12h UTC).
|
|
#define | EPOCH_UNIX_GPS 315964800 |
|
#define | M_C 299792458.0 |
| Speed of light.
|
|
|
string | GetTimeStampFromGps (const unsigned int aGps) |
| Returns the time stamp from a GPS time.
|
|
struct tm * | GPSToUTC (struct tm *aUtc, unsigned int aGps) |
| Returns a pointer to a tm structure representing the time specified in seconds since the GPS epoch.
|
|
double | GreenwichMeanSiderealTime (const double aGps) |
| Returns the Greenwich Mean Sidereal Time in RADIANS for a specified GPS time.
|
|
double | GreenwichSiderealTime (const double aGps, const double aEquationOfEquinoxes) |
| Returns the Greenwich mean or aparent sideral time in radians.
|
|
double | JulianDay (const struct tm *aUtc) |
| Returns the Julian Day (JD) corresponding to the date given in a broken down time structure.
|
|
int | LeapSeconds (const unsigned int aGps) |
| Returns the leap seconds TAI-UTC at a given GPS second.
|
|
int | LeapSecondsUTC (const struct tm *aUtc) |
| Returns the leap seconds TAI-UTC for a given UTC broken down time.
|
|
unsigned int | UTCToGPS (const struct tm *aUtc) |
| Returns the GPS seconds for a specified UTC time structure.
|
|
Generic timing routines.
- Author
- Karl Wette, Duncan Brown, David Chin, Jolien Creighton, Kipp Cannon, Reinhard Prix, Stephen Fairhurst, Florent Robinet
◆ EPOCH_GPS_TAI_UTC
#define EPOCH_GPS_TAI_UTC 19 |
Leap seconds (TAI-UTC) on the GPS epoch (1980 JAN 6 0h UTC) */.
◆ EPOCH_J2000_0_JD
#define EPOCH_J2000_0_JD 2451545.0 |
Julian Day of the J2000.0 epoch (2000 JAN 1 12h UTC).
◆ EPOCH_UNIX_GPS
#define EPOCH_UNIX_GPS 315964800 |
◆ M_C
◆ GetTimeStampFromGps()
string GetTimeStampFromGps |
( |
const unsigned int |
aGps | ) |
|
Returns the time stamp from a GPS time.
Format: "%Y-%b-%d %H:%M:%S"
- Parameters
-
◆ GPSToUTC()
struct tm * GPSToUTC |
( |
struct tm * |
aUtc, |
|
|
unsigned int |
aGps |
|
) |
| |
Returns a pointer to a tm structure representing the time specified in seconds since the GPS epoch.
- Parameters
-
[out] | aUtc | Pointer to a time structure. |
[in] | aGps | GPS time [s]. |
◆ GreenwichMeanSiderealTime()
double GreenwichMeanSiderealTime |
( |
const double |
aGps | ) |
|
Returns the Greenwich Mean Sidereal Time in RADIANS for a specified GPS time.
Convenience wrapper, calling GreenwichSiderealTime() with the equation of equinoxes set to 0.
- Parameters
-
◆ GreenwichSiderealTime()
double GreenwichSiderealTime |
( |
const double |
aGps, |
|
|
const double |
aEquationOfEquinoxes |
|
) |
| |
Returns the Greenwich mean or aparent sideral time in radians.
Aparent sidereal time is computed by providing the equation of equinoxes in units of seconds. For mean sidereal time, set this parameter to 0.
This function returns the sidereal time in radians measured from the Julian epoch (current J2000). The result is NOT modulo 2 pi.
Inspired by the function sidereal_time() in the NOVAS-C library, version 2.0.1, which is dated December 10th, 1999, and carries the following references:
Aoki, et al. (1982) Astronomy and Astrophysics 105, 359-361. Kaplan, G. H. "NOVAS: Naval Observatory Vector Astrometry
Subroutines"; USNO internal document dated 20 Oct 1988; revised 15 Mar 1990.
- See also
- http://aa.usno.navy.mil/software/novas for more information.
- Parameters
-
[in] | aGps | GPS time [s]. |
[in] | aEquationOfEquinoxes | Equation of equinoxes in [s]. For mean sidereal time, set this parameter to 0. |
◆ JulianDay()
double JulianDay |
( |
const struct tm * |
aUtc | ) |
|
Returns the Julian Day (JD) corresponding to the date given in a broken down time structure.
- Parameters
-
[in] | aUtc | Pointer to a time structure. |
◆ LeapSeconds()
int LeapSeconds |
( |
const unsigned int |
aGps | ) |
|
Returns the leap seconds TAI-UTC at a given GPS second.
- Parameters
-
◆ LeapSecondsUTC()
int LeapSecondsUTC |
( |
const struct tm * |
aUtc | ) |
|
Returns the leap seconds TAI-UTC for a given UTC broken down time.
- Parameters
-
[in] | aUtc | Pointer to a time structure. |
◆ UTCToGPS()
unsigned int UTCToGPS |
( |
const struct tm * |
aUtc | ) |
|
Returns the GPS seconds for a specified UTC time structure.
- Parameters
-
[in] | aUtc | Pointer to a time structure. |