COSMOS core
1.0.2 (beta)
Comprehensive Open-architecture Solution for Mission Operations Systems
|
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 | mjdToGregorian (double mjd, int32_t *year, int32_t *month, int32_t *day, int32_t *hour, int32_t *minute, int32_t *second) |
int32_t | mjd2tlef (double mjd, string &tle) |
Convert mjd to the TLE epoch format. More... | |
double | tt2tdb (double mjd) |
double | set_local_clock (double utc_to) |
double currentmjd | ( | double | offset | ) |
Current UTC in Modified Julian Days.
offset | MJD offset to be apllied to turn actual time in to simulated time. |
double currentmjd | ( | ) |
unsigned long get_unix_time | ( | ) |
string get_local_time | ( | ) |
double unix2utc | ( | struct timeval | unixtime | ) |
Unix time to UTC.
Convert Unix time in a timeval structure to a double precision number representing Mofidied Julian Day.
unixtime | Unix time to be converted. |
double unix2utc | ( | double | unixtime | ) |
Unix time to UTC.
Convert Unix time in seconds to a double precision number representing Mofidied Julian Day.
unixtime | Unix time in decimal seconds. |
struct timeval utc2unix | ( | double | utc | ) |
UTC to Unix time.
Convert UTC in Modified Julian Day to a timeval structure representing Unix time.
utc | as Modified Julian Day. |
double utc2unixseconds | ( | double | utc | ) |
UTC to Unix time.
Convert UTC in Modified Julian Day to a double representing Unix time.
utc | as Modified Julian Day. |
calstruc mjd2cal | ( | double | mjd | ) |
MJD to Calendar.
Convert Modified Julian Day to Calendar Year, Month, Day, Hour, Minute, Second and Nanosecond.
mjd | Modified Julian Day |
int32_t mjd2ymd | ( | double | mjd, |
int32_t & | year, | ||
int32_t & | month, | ||
double & | day | ||
) |
MJD to Year, Month, and Decimal Day (overloaded)
Convert Modified Julian Day to Calendar Year, Month, Decimal Day. basically it just calls mjd2ymd with all the arguments
mjd | Modified Julian Day |
year | Pointer to return Calendar Year |
month | Pointer to return Calendar Month |
day | Pointer to return Decimal Day of the Month |
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)
Convert Modified Julian Day to Calendar Year, Month, Decimal Day.
mjd | Modified Julian Day |
year | Pointer to return Calendar Year |
month | Pointer to return Calendar Month |
day | Pointer to return Decimal Day of the Month |
doy | Pointer to return Decimal Day of the Year |
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.
Convert a full calendar representation of date and time to MJD. If month is given as zero, then day will be taken as day of the year.
year | Full representation of year. |
month | Calendar month, or zero. |
day | Day of month if 1 <= month <=12, otherwise day of year. |
hour | Hour of day (0-23) |
minute | Minute of day (0-59) |
second | Second of day (0-59) |
nsecond | Nanosecond of day (0-999999999) |
double cal2mjd | ( | double | year | ) |
Calendar representation YYYY.ffff to Modified Julian Day - overloaded.
Convert a shortened calendar representation of date to MJD.
year | Full representation of decimal year. |
double cal2mjd | ( | int32_t | year, |
double | dayOfYear | ||
) |
Calendar representation YYYY,DDD.ffff to Modified Julian Day - overloaded.
Convert a shortened calendar representation of date to MJD. Day argument is day of year.
year | Full representation of year. |
dayOfYear | day of year. |
double cal2mjd | ( | int32_t | year, |
int32_t | month, | ||
double | day | ||
) |
Calendar representation to Modified Julian Day - shortened.
Convert a shortened calendar representation of date to MJD. Time is taken from the fractional part of the day. If month is given as zero, then day will be taken as day of the year.
year | Full representation of year. |
month | Calendar month, or zero. |
day | Day of month if 1 <= month <=12, otherwise day of year. |
double cal2mjd | ( | calstruc | date | ) |
Calendar representation to Modified Julian Day - structure.
Convert a full calendar representation of date and time to MJD. If month is given as zero, then day will be taken as day of the year.
date | Full representation of date and time in calstruc. |
double gregorianToModJulianDate | ( | int32_t | year, |
int32_t | month, | ||
int32_t | day, | ||
int32_t | hour, | ||
int32_t | minute, | ||
double | second | ||
) |
Get Modified Julian Date from Gregorian Calendar Date in UTC
year | |
month | |
day | |
hour | |
minute | |
second | (for high precision mjd) |
double utc2jcentt | ( | double | mjd | ) |
TT Julian Century.
Caculate the number of centuries since J2000, Terrestrial Time, for the provided date.
mjd | Date in Modified Julian Day. |
double utc2jcenut1 | ( | double | mjd | ) |
UT1 Julian Century.
Caculate the number of centuries since J2000, UT1, for the provided date.
mjd | Date in Modified Julian Day. |
rvector utc2nuts | ( | double | mjd | ) |
Nutation values.
Calculate the nutation values from the JPL Ephemeris for the provided UTC date. Values are in order: Psi, Epsilon, dPsi, dEpsilon. Units are radians and radians/second.
mjd | UTC in Modified Julian Day. |
double utc2dpsi | ( | double | mjd | ) |
Nutation Delta Psi value.
Calculate the Delta Psi value (nutation in longitude), for use in the Nutation matrix, for the provided UTC date.
mjd | UTC in Modified Julian Day. |
double utc2depsilon | ( | double | mjd | ) |
Nutation Delta Epsilon value.
Calculate the Delta Psi value (nutation in obliquity), for use in the Nutation matrix, for the provided UTC date.
mjd | UTC in Modified Julian Day. |
double utc2epsilon | ( | double | mjd | ) |
Nutation Epsilon value.
Calculate the Epsilon value (obliquity of the ecliptic), for use in the Nutation matrix, for the provided UTC date.
mjd | UTC in Modified Julian Day. |
double utc2L | ( | double | mjd | ) |
Nutation L value.
Calculate the L value, for use in the Nutation matrix, for the provided UTC date.
mjd | UTC in Modified Julian Day. |
double utc2Lp | ( | double | mjd | ) |
Nutation L prime value.
Calculate the L prime value, for use in the Nutation matrix, for the provided UTC date.
mjd | UTC in Modified Julian Day. |
double utc2F | ( | double | mjd | ) |
Nutation F value.
Calculate the F value, for use in the Nutation matrix, for the provided UTC date.
mjd | UTC in Modified Julian Day. |
double utc2D | ( | double | mjd | ) |
Nutation D value.
Calculate the D value, for use in the Nutation matrix, for the provided UTC date.
mjd | UTC in Modified Julian Day. |
double utc2omega | ( | double | mjd | ) |
Nutation omega value.
Calculate the omega value, for use in the Nutation matrix, for the provided UTC date.
mjd | UTC in Modified Julian Day. |
double utc2zeta | ( | double | utc | ) |
Precession zeta value.
Calculate angle zeta used in the calculation of Precession, re. Capitaine, et. al, A&A, 412, 567-586 (2003) Expressions for IAU 2000 precession quantities Equation 40
utc | Epoch in Modified Julian Day. |
double utc2z | ( | double | utc | ) |
Precession z value.
Calculate angle z used in the calculation of Precession, re. Capitaine, et. al, A&A, 412, 567-586 (2003) Expressions for IAU 2000 precession quantities Equation 40
utc | Epoch in Modified Julian Day. |
double utc2theta | ( | double | utc | ) |
Precession theta value.
Calculate angle theta used in the calculation of Precession, re. Capitaine, et. al, A&A, 412, 567-586 (2003) Expressions for IAU 2000 precession quantities Equation 40
utc | Epoch in Modified Julian Day. |
double utc2dut1 | ( | double | mjd | ) |
Calculate DUT1.
Calculate DUT1 = UT1 - UTC, based on lookup in IERS Bulletin A.
mjd | UTC in Modified Julian Day. |
double utc2ut1 | ( | double | mjd | ) |
Convert UTC to UT1.
Convert Coordinated Universal Time to Universal Time by correcting for the offset between them at the given time. Table of DUT1 is first initialized from disk if it hasn't yet been.
mjd | UTC in Modified Julian Day. |
double julcen | ( | double | mjd | ) |
double utc2tdb | ( | double | mjd | ) |
Convert UTC to TDB.
Convert Coordinated Universal Time to Barycentric Dynamical Time by correcting for the mean variations as a function of Julian days since 4713 BC Jan 1.5.
mjd | UTC in Modified Julian Day. |
double tt2utc | ( | double | mjd | ) |
Convert TT to UTC.
Convert Terrestrial Dynamical Time to Coordinated Universal Time by correcting for the appropriate number of Leap Seconds. Leap Second table is first initialized from disk if it hasn't yet been.
mjd | TT in Modified Julian Day. |
double utc2tt | ( | double | mjd | ) |
Convert UTC to TT.
Convert Coordinated Universal Time to Terrestrial Dynamical Time by correcting for the appropriate number of Leap Seconds. Leap Second table is first initialized from disk if it hasn't yet been.
mjd | UTC in Modified Julian Day. |
double utc2gps | ( | double | utc | ) |
Convert UTC to GPS.
Convert Coordinated Universal Time to GPS Time, correcting for the appropriate number of leap seconds. Leap Second table is first initialized from disk if it hasn't yet been.
utc | UTC expressed in Modified Julian Days |
double gps2utc | ( | double | gps | ) |
Convert GPS to UTC.
Convert GPS Time to Coordinated Universal Time, correcting for the appropriate number of leap seconds. Leap Second table is first initialized from disk if it hasn't yet been.
gps | GPS Time expressed in Modified Julian Days |
void gps2week | ( | double | gps, |
uint32_t & | week, | ||
double & | seconds | ||
) |
GPS Weeks and Seconds from GPS time.
Calculate the appropriate GPS week and remaining seconds from the provided GPS time.
gps | GPS time expressed as Modified Julian Day |
week | Pointer to the returned GPS week. |
seconds | Ponter to the returned GPS seconds. |
double week2gps | ( | uint32_t | week, |
double | seconds | ||
) |
GPS Time from GPS Week and Seconds.
Calculate the appropriate GPS Time from the provided GPS Week and Seconds.
week | GPS Week. |
seconds | GPS Seconds. |
double mjd2year | ( | double | mjd | ) |
Year from MJD.
Return the Decimal Year for the provided MJD
mjd | Modified Julian Data |
double mjd2doy | ( | double | mjd | ) |
Day of Year from MJD.
Return the Decimal Day of Year for the provided MJD
mjd | Modified Julian Data |
double utc2era | ( | double | mjd | ) |
Earth Rotation Angle.
Calculate the Earth Rotation Angle for a given Earth Rotation Time based on the provided UTC.
mjd | Coordinated Universal Time as Modified Julian Day. |
double utc2gast | ( | double | mjd | ) |
UTC to GAST.
Convert current UTC to Greenwhich Apparent Sidereal Time. Accounts for nutations.
mjd | UTC as Modified Julian Day |
double utc2gmst1982 | ( | double | mjd | ) |
double utc2gmst2000 | ( | double | utc | ) |
double ranrm | ( | double | angle | ) |
int16_t isleap | ( | int32_t | year | ) |
Check for Leap year.
Check whether the specified year (Gregorian or Julian calendar) is a Leap year.
year | Year to check |
int32_t load_iers | ( | ) |
Load IERS Polar Motion, UT1-UTC, Leap Seconds.
Allocate and load array for storing data from IERS file. Each record includes the MJD, the Polar Motion for X and Y in radians, UT1-UTC in seconds of time, and the number of Leap Seconds since the creation of TAI in 1958. The following are then defined:
int32_t leap_seconds | ( | double | mjd | ) |
Leap Seconds.
Returns number of leap seconds for provided Modified Julian Day.
mjd | Provided time. |
cvector polar_motion | ( | double | mjd | ) |
Polar motion.
Returns polar motion in radians for provided Modified Julian Day.
mjd | Provided time. |
string utc2unixdate | ( | double | utc | ) |
Time for setting unix date.
Represent the given UTC on a format appropriate for setting Unix date format: MMDDhhmmYY.ss
utc | Coordinated Universal Time expressed in Modified Julian Days. |
string utc2iso8601 | ( | double | utc | ) |
ISO 8601 version of time.
Represent the given UTC as an extended calendar format ISO 8601 string in the format: YYYY-MM-DDTHH:MM:SS
utc | Coordinated Universal Time expressed in Modified Julian Days. |
double iso86012utc | ( | string | date | ) |
string mjd2iso8601 | ( | double | mjd | ) |
int32_t dayFraction2hms | ( | double | dayFraction, |
int32_t * | hour, | ||
int32_t * | minute, | ||
int32_t * | second | ||
) |
Convert Modified Julian Date to Time of day (hour, minute, second.fff)
dayFraction | |
hour | Pointer to return Hour of the day |
minute | Pointer to return Minute of the day |
second | Pointer to return Second of the day (decimal) |
int32_t mjdToGregorian | ( | double | mjd, |
int32_t & | year, | ||
int32_t & | month, | ||
int32_t & | day, | ||
int32_t & | hour, | ||
int32_t & | minute, | ||
int32_t & | second | ||
) |
Convert Modified Julian Date to standard Gregorian Date-Time
mjd | (Modified Julian Days) |
year | Pointer to return Calendar Year |
month | Pointer to return Calendar Month |
day | Pointer to return Decimal Day of the Month |
hour | Pointer to return Hour of the day |
minute | Pointer to return Minute of the day |
second | Pointer to return Second of the day (decimal) |
string mjdToGregorian | ( | double | mjd | ) |
Convert Modified Julian Date to international standard Gregorian Date-Time in the format: YYYY-MM-DD HH:MM:SS (ex. 2014-09-15 12:00:00) (previously this function was named mjd2human)
mjd | Time in Modified Julian Days |
string mjdToGregorianFormat | ( | double | mjd | ) |
Convert Modified Julian Date to international standard Gregorian Date-Time in the format: YYYY-MM-DDTHHMMSS (ex. 2014-09-15T120000)
mjd | Time in Modified Julian Days |
string mjdToGregorianDDMMMYYYY | ( | double | mjd | ) |
Convert Modified Julian Date to US standard Gregorian Date-Time with 3-letter month format: DD-MMM-YYYY HH:MM:SS (ex. 15-SEP-2014 12:00:00) (previously this function was named mjd2human2)
mjd | Time in Modified Julian Days |
string mjdToGregorianDDMmmYYYY | ( | double | mjd | ) |
Convert Modified Julian Date to US standard Gregorian Date-Time with 3-letter month format in small caps: DD mmm YYYY HH:MM:SS.FFF (15 Sep 2014 12:00:00.000) Used for STK remote (previously this function was named mjd2human3)
mjd | Time in Modified Julian Days |
string seconds2DDHHMMSS | ( | double | elapsed_seconds | ) |
Convert Elapsed Time in Seconds to Human Readable Format (used for GPS simulator)
UTC string in the format: DD HH:MM:SS
elapsed_seconds |
double mjd2jd | ( | double | mjd | ) |
Modified Julian Day to Julian Day.
Convert date in Modified Julian Day format to date in Julian Day format.
mjd | Date in Modified Julian Day format. |
double jd2mjd | ( | double | jd | ) |
int32_t timed_countdown | ( | int32_t | seconds, |
int32_t | step, | ||
string | message | ||
) |
int32_t mjdToGregorian | ( | double | mjd, |
int32_t * | year, | ||
int32_t * | month, | ||
int32_t * | day, | ||
int32_t * | hour, | ||
int32_t * | minute, | ||
int32_t * | second | ||
) |
int32_t mjd2tlef | ( | double | mjd, |
string & | tle | ||
) |
Convert mjd to the TLE epoch format.
double tt2tdb | ( | double | mjd | ) |
double set_local_clock | ( | double | utc_to | ) |