COSMOS core  1.0.2 (beta)
Comprehensive Open-architecture Solution for Mission Operations Systems
timelib.cpp File Reference

Time handling library source file. More...

#include "support/timelib.h"
#include "support/datalib.h"
#include "support/ephemlib.h"
#include "math/mathlib.h"
Include dependency graph for timelib.cpp:

Classes

struct  iersstruc
 

Macros

#define MAXLEAPS   26
 

Functions

double currentmjd (double offset)
 Current UTC in Modified Julian Days. More...
 
double currentmjd ()
 
unsigned long int get_unix_time ()
 
string get_local_time ()
 
double unix2utc (struct timeval unixtime)
 Unix time to UTC. More...
 
double unix2utc (double unixtime)
 Unix time to UTC. More...
 
struct timeval utc2unix (double utc)
 UTC to Unix time. More...
 
double utc2unixseconds (double utc)
 UTC to Unix time. More...
 
calstruc mjd2cal (double mjd)
 MJD to Calendar. More...
 
int32_t mjd2ymd (double mjd, int32_t &year, int32_t &month, double &day)
 MJD to Year, Month, and Decimal Day (overloaded) More...
 
int32_t mjd2ymd (double mjd, int32_t &year, int32_t &month, double &day, double &doy)
 MJD to Year, Month, Decimal Day, and Julian Day (overloaded) More...
 
double cal2mjd (int32_t year, int32_t month, int32_t day, int32_t hour, int32_t minute, int32_t second, int32_t nsecond)
 Calendar representation to Modified Julian Day - full. More...
 
double cal2mjd (double year)
 Calendar representation YYYY.ffff to Modified Julian Day - overloaded. More...
 
double cal2mjd (int32_t year, double dayOfYear)
 Calendar representation YYYY,DDD.ffff to Modified Julian Day - overloaded. More...
 
double cal2mjd (int32_t year, int32_t month, double day)
 Calendar representation to Modified Julian Day - shortened. More...
 
double cal2mjd (calstruc date)
 Calendar representation to Modified Julian Day - structure. More...
 
double gregorianToModJulianDate (int32_t year, int32_t month, int32_t day, int32_t hour, int32_t minute, double second)
 
double utc2jcentt (double mjd)
 TT Julian Century. More...
 
double utc2jcenut1 (double mjd)
 UT1 Julian Century. More...
 
rvector utc2nuts (double mjd)
 Nutation values. More...
 
double utc2dpsi (double mjd)
 Nutation Delta Psi value. More...
 
double utc2depsilon (double mjd)
 Nutation Delta Epsilon value. More...
 
double utc2epsilon (double mjd)
 Nutation Epsilon value. More...
 
double utc2L (double mjd)
 Nutation L value. More...
 
double utc2Lp (double mjd)
 Nutation L prime value. More...
 
double utc2F (double mjd)
 Nutation F value. More...
 
double utc2D (double mjd)
 Nutation D value. More...
 
double utc2omega (double mjd)
 Nutation omega value. More...
 
double utc2zeta (double utc)
 Precession zeta value. More...
 
double utc2z (double utc)
 Precession z value. More...
 
double utc2theta (double utc)
 Precession theta value. More...
 
double utc2dut1 (double mjd)
 Calculate DUT1. More...
 
double utc2ut1 (double mjd)
 Convert UTC to UT1. More...
 
double julcen (double mjd)
 Julian Century. More...
 
double utc2tdb (double mjd)
 Convert UTC to TDB. More...
 
double tt2utc (double mjd)
 Convert TT to UTC. More...
 
double utc2tt (double mjd)
 Convert UTC to TT. More...
 
double utc2gps (double utc)
 Convert UTC to GPS. More...
 
double gps2utc (double gps)
 Convert GPS to UTC. More...
 
void gps2week (double gps, uint32_t &week, double &seconds)
 GPS Weeks and Seconds from GPS time. More...
 
double week2gps (uint32_t week, double seconds)
 GPS Time from GPS Week and Seconds. More...
 
double mjd2year (double mjd)
 Year from MJD. More...
 
double mjd2doy (double mjd)
 Day of Year from MJD. More...
 
double utc2era (double mjd)
 Earth Rotation Angle. More...
 
double utc2gast (double mjd)
 UTC to GAST. More...
 
double utc2gmst1982 (double mjd)
 UTC (Modified Julian Day) to GMST. More...
 
double utc2gmst2000 (double utc)
 
double ranrm (double angle)
 
int16_t isleap (int32_t year)
 Check for Leap year. More...
 
int32_t load_iers ()
 Load IERS Polar Motion, UT1-UTC, Leap Seconds. More...
 
int32_t leap_seconds (double mjd)
 Leap Seconds. More...
 
cvector polar_motion (double mjd)
 Polar motion. More...
 
string utc2unixdate (double utc)
 Time for setting unix date. More...
 
string utc2iso8601 (double utc)
 ISO 8601 version of time. More...
 
double iso86012utc (string date)
 
string mjd2iso8601 (double mjd)
 
int32_t dayFraction2hms (double dayFraction, int32_t *hour, int32_t *minute, int32_t *second)
 
int32_t mjdToGregorian (double mjd, int32_t &year, int32_t &month, int32_t &day, int32_t &hour, int32_t &minute, int32_t &second)
 
string mjdToGregorian (double mjd)
 
string mjdToGregorianFormat (double mjd)
 
string mjdToGregorianDDMMMYYYY (double mjd)
 
string mjdToGregorianDDMmmYYYY (double mjd)
 
string seconds2DDHHMMSS (double elapsed_seconds)
 Convert Elapsed Time in Seconds to Human Readable Format (used for GPS simulator) More...
 
double mjd2jd (double mjd)
 Modified Julian Day to Julian Day. More...
 
double jd2mjd (double jd)
 Julian Day to Modified Julian Day. More...
 
int32_t timed_countdown (int32_t seconds, int32_t step, string message)
 
int32_t mjd2tlef (double mjd, string &tle)
 Convert mjd to the TLE epoch format. More...
 
double set_local_clock (double utc_to)
 

Variables

static vector< iersstruciers
 
static uint32_t iersbase =0
 
double leaps [26]
 

Detailed Description

Time handling library source file.

Macro Definition Documentation

#define MAXLEAPS   26

Variable Documentation

vector<iersstruc> iers
static
uint32_t iersbase =0
static
double leaps[26]
Initial value:
=
{41370.,41498.,41682.,42047.,42412.,42777.,43143.,43508.,43873.,44238.,44785.,45150.,45515.,46246.,47160.,47891.,48256.,48803.,49168.,49533.,50082.,50629.,51178.,53735.,54831.,56108.}