![]() |
QP
0.7-SNAPSHOT
Control software for the ??SRT telescope
|
Encapsulates a few time properties which are astronomically relevant. More...
#include <astrotime.h>
Public Member Functions | |
const double | gmst_2pi (void) const |
The following calculates GMST of date, in radians. More... | |
const double | lmst (void) const |
Returns the Local Mean Sidereal Time at the observatory. | |
const double | ut1 (void) const |
Return UT1 as a number of hours. More... | |
const int | mjd (void) const |
Return the MJD at time 00:00 on the indicated day. More... | |
AstroTime () | |
The default constructor produces a valid, but largely useless structure, representing midnight on 1858 November 17 (MJD=0) at the meridian. | |
AstroTime (const int year, const int month, const int day, const int hour, const int minute, const double second, const double obslong) | |
Create a new time. More... | |
AstroTime (const AstroTime &ref, const double extra_secs) | |
Return a new astrotime, with the time given by the tm struct. More... | |
AstroTime (const int year, const int month, const int day) | |
Create a new time. More... | |
AstroTime | move (double obs_lon) |
Return a new AstroTime representing the same UT as this one, but for a different observatory longitude. More... | |
char * | str (char *, size_t) |
Format the current time into the given buffer. More... | |
Encapsulates a few time properties which are astronomically relevant.
AstroTime::AstroTime | ( | const int | year, |
const int | month, | ||
const int | day, | ||
const int | hour, | ||
const int | minute, | ||
const double | second, | ||
const double | obslong | ||
) |
Create a new time.
The time must be given in UT1.
year | must be after 1859 (ie, positive MJD) |
month | month in [1, 12] |
day | day in [1, 31] |
hour | UT1 hour, positive |
minute | UT1 minute, positive |
second | UT1 second, positive |
obslong | the observatory east-longitude, in radians |
AstroTime::AstroTime | ( | const AstroTime & | ref, |
const double | extra_secs | ||
) |
Return a new astrotime, with the time given by the tm struct.
Returns a new time, offset from the reference time by a number of UT1 seconds.
AstroTime::AstroTime | ( | const int | year, |
const int | month, | ||
const int | day | ||
) |
Create a new time.
The time is given in LST on the supplied date. LST must be supplied in radians in the range [0,2pi). Create a new time, defaulting to noon.
const double AstroTime::gmst_2pi | ( | void | ) | const |
The following calculates GMST of date, in radians.
This evaluates the expression for GMST in terms of UT, as given in Explanatory Supplement Eq.2.24-1, but with the resulting time normalised to be in [0,2pi)
const int AstroTime::mjd | ( | void | ) | const |
Return the MJD at time 00:00 on the indicated day.
This is a round number.
AstroTime AstroTime::move | ( | double | new_obs_lon | ) |
Return a new AstroTime representing the same UT as this one, but for a different observatory longitude.
new_obs_lon | the observatory east-longitude, in radians |
char * AstroTime::str | ( | char * | buf, |
size_t | buflen | ||
) |
Format the current time into the given buffer.
buf | a buffer to receive the formatted string |
buflen | the size of this buffer; if the string would be longer than this it is truncated |
const double AstroTime::ut1 | ( | void | ) | const |
Return UT1 as a number of hours.
The result is always in the range [0, 24).