#include <ArrayTime.h>
Inherits asdm::Interval.
All dates are assumed to be in the Gregorian calendar, including those prior to October 15, 1582. So, if you are interested in very old dates, this isn't the most convenient class to use.
Internally the time is kept in units of nanoseconds (10-9 seconds). The base time is 17 November 1858 00:00:00 UTC, and the maximum time is to the year 2151 (2151-02-25T23:47:16.854775807). This differs from the OMG Time service The OMG time is in units of 100 nanoseconds using the beginning of the Gregorian calandar,15 October 1582 00:00:00 UTC, as the base time. The reason for this increased accuracy is that the Control system is capable of measuring time to an accuracy of 40 nanoseconds. Therefore, by adhering to the representation of time used in the OMG Time Serivce we would be losing precision.
The Time class is an extension of the Interval class, since all times are intervals since 17 November 1858 00:00:00 UTC.
All times in this class are assumed to be International Atomic Time (TAI). A specific TAI time differs from the corresponding UTC time by an offset that is an integral number of seconds.
In the methods that give various quantities associated with calendar times, this class does not apply any UTC corrections. Therefore, if you use these methods to produce calendar times, the results will differ from civil time by a few seconds. The classes UTCTime and LocalTime take the UTC and timezone corrections into account.
The main reference used in crafting these methods is Astronomical Algorithms by Jean Meeus, second edition, 2000, Willmann-Bell, Inc., ISBN 0-943396-61-1. See chapter 7, "Julian day", and chapter 12, "Sidereal Time".
Public Member Functions | |
ArrayTime (const string &s) | |
ArrayTime (const ArrayTime &t) | |
ArrayTime (const IDLArrayTime &t) | |
ArrayTime (int year, int month, double day) | |
ArrayTime (int year, int month, int day, int hour, int minute, double second) | |
ArrayTime (double modifiedJulianDay) | |
ArrayTime (int modifiedJulianDay, double secondsInADay) | |
ArrayTime (long long nanoseconds) | |
double | getJD () const |
double | getMJD () const |
double | getJDI () const |
double | getMJDI () const |
IDLArrayTime | toIDLArrayTime () const |
string | toFITS () const |
void | toBin (EndianOSStream &eoss) |
int * | getDateTime () const |
double | getTimeOfDay () const |
int | getDayOfWeek () const |
int | getDayOfYear () const |
string | timeOfDayToString () const |
double | getLocalSiderealTime (double longitudeInHours) const |
double | getGreenwichMeanSiderealTime () const |
Static Public Member Functions | |
static bool | isLeapYear (int year) |
static double | getMJD (double jd) |
static double | getJD (double mjd) |
static ArrayTime | add (const ArrayTime &time, const Interval &interval) |
static ArrayTime | sub (const ArrayTime &time, const Interval &interval) |
static ArrayTime | getArrayTime (StringTokenizer &t) |
static void | toBin (const vector< ArrayTime > &arrayTime, EndianOSStream &eoss) |
static void | toBin (const vector< vector< ArrayTime > > &arrayTime, EndianOSStream &eoss) |
static void | toBin (const vector< vector< vector< ArrayTime > > > &arrayTime, EndianOSStream &eoss) |
static ArrayTime | fromBin (EndianISStream &eiss) |
static vector< ArrayTime > | from1DBin (EndianISStream &eiss) |
static vector< vector< ArrayTime > > | from2DBin (EndianISStream &eiss) |
static vector< vector< vector< ArrayTime > > > | from3DBin (EndianISStream &eiss) |
static double | unitToJD (long long unit) |
static double | unitToMJD (long long unit) |
static long long | jdToUnit (double jd) |
static long long | mjdToUnit (double mjd) |
static double | utcCorrection (double jd) |
Static Public Attributes | |
static const int | numberSigDigitsInASecond = 9 |
static const long long | unitsInASecond = 1000000000LL |
static const long long | unitsInADayL = 86400000000000LL |
static const double | unitsInADay |
static const double | unitsInADayDiv100 |
static const double | julianDayOfBase |
static const long long | julianDayOfBaseInUnitsInADayDiv100 = 2073600432000000000LL |
void asdm::ArrayTime::toBin | ( | EndianOSStream & | eoss | ) |
Write the binary representation of this to a EndianOSStream.
Reimplemented from asdm::Interval.
static void asdm::ArrayTime::toBin | ( | const vector< ArrayTime > & | arrayTime, | |
EndianOSStream & | eoss | |||
) | [static] |
static void asdm::ArrayTime::toBin | ( | const vector< vector< ArrayTime > > & | arrayTime, | |
EndianOSStream & | eoss | |||
) | [static] |
static void asdm::ArrayTime::toBin | ( | const vector< vector< vector< ArrayTime > > > & | arrayTime, | |
EndianOSStream & | eoss | |||
) | [static] |
static ArrayTime asdm::ArrayTime::fromBin | ( | EndianISStream & | eiss | ) | [static] |
Read the binary representation of an ArrayTime from a EndianISStream and use the read value to set an ArrayTime.
eiss | the EndianStream to be read |
Reimplemented from asdm::Interval.
static vector<ArrayTime> asdm::ArrayTime::from1DBin | ( | EndianISStream & | eiss | ) | [static] |
Read the binary representation of a vector of ArrayTime from an EndianISStream and use the read value to set a vector of ArrayTime.
dis | the EndianISStream to be read |
Reimplemented from asdm::Interval.
static vector<vector<ArrayTime> > asdm::ArrayTime::from2DBin | ( | EndianISStream & | eiss | ) | [static] |
Read the binary representation of a vector of vector of ArrayTime from an EndianISStream and use the read value to set a vector of vector of ArrayTime.
eiis | the EndianISStream to be read |
Reimplemented from asdm::Interval.
static vector<vector<vector<ArrayTime> > > asdm::ArrayTime::from3DBin | ( | EndianISStream & | eiss | ) | [static] |