asdm::ArrayTime Class Reference
The ArrayTime class implements the concept of a point in time, implemented as an Interval of time since 17 November 1858 00:00:00 UTC, the beginning of the modified Julian Day.
More...
#include <ArrayTime.h>
List of all members.
Public Member Functions |
| ArrayTime () |
| The nullary constructor.
|
| ArrayTime (const string &s) |
| Builds an ArrayTime out of the content of a string.
|
| ArrayTime (const ArrayTime &t) |
| The copy constructor.
|
| ArrayTime (const IDLArrayTime &t) |
| Builds an ArrayTime from the CORBA/IDL representation of an ArrayTime.
|
| ArrayTime (int year, int month, double day) |
| Builds an ArrayTime from a triple (year, month, day).
|
| ArrayTime (int year, int month, int day, int hour, int minute, double second) |
| Build an ArrayTime from a sextuple (year, month, day, hour, minute, second.
|
| ArrayTime (double modifiedJulianDay) |
| Build an ArrayTime from an MJD date.
|
| ArrayTime (int modifiedJulianDay, double secondsInADay) |
| Build an ArrayTime from an MJD date.
|
| ArrayTime (int64_t nanoseconds) |
| Build an ArrayTime from a number of nanoseconds.
|
double | getJD () const |
| Return the julian day.
|
double | getMJD () const |
| Return the modified julian day.
|
IDLArrayTime | toIDLArrayTime () const |
string | toFITS () const |
void | toBin (EndianOSStream &eoss) |
| Write the binary representation of this to a EndianOSStream.
|
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) |
| Write the binary representation of a vector of ArrayTime to a EndianOSStream.
|
static void | toBin (const vector< vector< ArrayTime > > &arrayTime, EndianOSStream &eoss) |
| Write the binary representation of a vector of vector of ArrayTime to a EndianOSStream.
|
static void | toBin (const vector< vector< vector< ArrayTime > > > &arrayTime, EndianOSStream &eoss) |
| Write the binary representation of a vector of vector of vector of ArrayTime to a EndianOSStream.
|
static ArrayTime | fromBin (EndianIStream &eis) |
| Read the binary representation of an ArrayTime from a EndianIStream and use the read value to set an ArrayTime.
|
static vector< ArrayTime > | from1DBin (EndianIStream &eis) |
| Read the binary representation of a vector of ArrayTime from an EndianIStream and use the read value to set a vector of ArrayTime.
|
static vector< vector
< ArrayTime > > | from2DBin (EndianIStream &eis) |
| Read the binary representation of a vector of vector of ArrayTime from an EndianIStream and use the read value to set a vector of vector of ArrayTime.
|
static vector< vector< vector
< ArrayTime > > > | from3DBin (EndianIStream &eis) |
| Read the binary representation of a vector of vector of vector of ArrayTime from an EndianIStream and use the read value to set a vector of vector of vector of ArrayTime.
|
static double | unitToJD (int64_t unit) |
static double | unitToMJD (int64_t unit) |
static int64_t | jdToUnit (double jd) |
static int64_t | mjdToUnit (double mjd) |
static double | utcCorrection (double jd) |
Static Public Attributes |
static const int | numberSigDigitsInASecond |
| Useful constants.
|
static const int64_t | unitsInASecond |
static const int64_t | unitsInADayL |
static const double | unitsInADay |
static const double | unitsInADayDiv100 |
static const double | julianDayOfBase |
static const int64_t | julianDayOfBaseInUnitsInADayDiv100 |
Private Member Functions |
int64_t | FITSString (string t) const |
Static Private Member Functions |
static int64_t | init (int year, int month, double day) |
static int64_t | init (int year, int month, int day, int hour, int minute, double second) |
Static Private Attributes |
static const UTCCorrection * | UTCCorrectionTable |
static const UTCCorrection | UTCLast |
Detailed Description
The ArrayTime class implements the concept of a point in time, implemented as an Interval of time since 17 November 1858 00:00:00 UTC, the beginning of the modified Julian Day.
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".
- Version:
- 1.0 12 January, 2004
- Author:
- Allen Farris
- Version:
- 1.1 Aug 8, 2006
- Author:
- Michel Caillat added toBin/fromBin methods.
Definition at line 94 of file ArrayTime.h.
Constructor & Destructor Documentation
asdm::ArrayTime::ArrayTime |
( |
|
) |
|
The nullary constructor.
Builds an ArrayTime corresponding to the origin of time i. e. 17 November 1858 00:00:00 UTC
asdm::ArrayTime::ArrayTime |
( |
const string & |
s |
) |
|
Builds an ArrayTime out of the content of a string.
If the string contains the textual representation of a double precision value then it will be considered as an MJD date. If the strign contains the textual representation of an integer value then it will be considered as an interval of time counted in nanoseconds since the 17 November 1858 00:00:00 UTC.
- Parameters:
-
| s | a const reference to a string. |
asdm::ArrayTime::ArrayTime |
( |
const ArrayTime & |
t |
) |
|
The copy constructor.
- Parameters:
-
asdm::ArrayTime::ArrayTime |
( |
const IDLArrayTime & |
t |
) |
|
Builds an ArrayTime from the CORBA/IDL representation of an ArrayTime.
- Parameters:
-
| t | a const reference to an IDLArrayTime. |
asdm::ArrayTime::ArrayTime |
( |
int |
year, |
|
|
int |
month, |
|
|
double |
day | |
|
) |
| | |
Builds an ArrayTime from a triple (year, month, day).
- Parameters:
-
| year | a positive integer value, |
| month | an integer in the range [1, 12], |
| day | a value in double precision, whose integer value must be in a valid range depending on the month. |
- Exceptions:
-
| InvalidArgumentException. | |
asdm::ArrayTime::ArrayTime |
( |
int |
year, |
|
|
int |
month, |
|
|
int |
day, |
|
|
int |
hour, |
|
|
int |
minute, |
|
|
double |
second | |
|
) |
| | |
Build an ArrayTime from a sextuple (year, month, day, hour, minute, second.
- Parameters:
-
| year | a positive integer value, |
| month | an integer in the range [1, 12], |
| day | an integer in the usual range depending on the month, |
| hour | an integer in the range [0, 23], |
| minute | an integer value in the range [0, 59], |
| second | a value in double precision whose integer part must be in the range [0, 59]. |
- Exceptions:
-
| InvalidArgumentException. | |
asdm::ArrayTime::ArrayTime |
( |
double |
modifiedJulianDay |
) |
|
Build an ArrayTime from an MJD date.
- Parameters:
-
| modifieJulianDay | a value in double precision. |
asdm::ArrayTime::ArrayTime |
( |
int |
modifiedJulianDay, |
|
|
double |
secondsInADay | |
|
) |
| | |
Build an ArrayTime from an MJD date.
- Parameters:
-
| modifiedJulianDay | an integer value to express the integer part of the MJD date, |
| secondsInADay | a value in double precision to express the decimal part of the MJD date. |
asdm::ArrayTime::ArrayTime |
( |
int64_t |
nanoseconds |
) |
|
Build an ArrayTime from a number of nanoseconds.
- Parameters:
-
| nanoseconds | a int64_t integer value to express a number of nanoseconds since 17 November 1858 00:00:00 UTC. |
Member Function Documentation
int64_t asdm::ArrayTime::FITSString |
( |
string |
t |
) |
const [private] |
Read the binary representation of a vector of vector of vector of ArrayTime from an EndianIStream and use the read value to set a vector of vector of vector of ArrayTime.
- Parameters:
-
- Returns:
- a vector of vector of vector of ArrayTime
int* asdm::ArrayTime::getDateTime |
( |
|
) |
const |
int asdm::ArrayTime::getDayOfWeek |
( |
|
) |
const |
int asdm::ArrayTime::getDayOfYear |
( |
|
) |
const |
double asdm::ArrayTime::getGreenwichMeanSiderealTime |
( |
|
) |
const |
double asdm::ArrayTime::getJD |
( |
|
) |
const |
Return the julian day.
- Returns:
- a value in double precision expressing this in julian day.
static double asdm::ArrayTime::getJD |
( |
double |
mjd |
) |
[static] |
double asdm::ArrayTime::getLocalSiderealTime |
( |
double |
longitudeInHours |
) |
const |
double asdm::ArrayTime::getMJD |
( |
|
) |
const |
Return the modified julian day.
- Returns:
- a value in double precision expressing this in modified julian day.
static double asdm::ArrayTime::getMJD |
( |
double |
jd |
) |
[static] |
double asdm::ArrayTime::getTimeOfDay |
( |
|
) |
const |
static int64_t asdm::ArrayTime::init |
( |
int |
year, |
|
|
int |
month, |
|
|
int |
day, |
|
|
int |
hour, |
|
|
int |
minute, |
|
|
double |
second | |
|
) |
| | [static, private] |
static int64_t asdm::ArrayTime::init |
( |
int |
year, |
|
|
int |
month, |
|
|
double |
day | |
|
) |
| | [static, private] |
static bool asdm::ArrayTime::isLeapYear |
( |
int |
year |
) |
[static] |
static int64_t asdm::ArrayTime::jdToUnit |
( |
double |
jd |
) |
[static] |
static int64_t asdm::ArrayTime::mjdToUnit |
( |
double |
mjd |
) |
[static] |
string asdm::ArrayTime::timeOfDayToString |
( |
|
) |
const |
static void asdm::ArrayTime::toBin |
( |
const vector< vector< vector< ArrayTime > > > & |
arrayTime, |
|
|
EndianOSStream & |
eoss | |
|
) |
| | [static] |
static void asdm::ArrayTime::toBin |
( |
const vector< vector< ArrayTime > > & |
arrayTime, |
|
|
EndianOSStream & |
eoss | |
|
) |
| | [static] |
string asdm::ArrayTime::toFITS |
( |
|
) |
const |
IDLArrayTime asdm::ArrayTime::toIDLArrayTime |
( |
|
) |
const |
static double asdm::ArrayTime::unitToJD |
( |
int64_t |
unit |
) |
[static] |
static double asdm::ArrayTime::unitToMJD |
( |
int64_t |
unit |
) |
[static] |
static double asdm::ArrayTime::utcCorrection |
( |
double |
jd |
) |
[static] |
Member Data Documentation
The documentation for this class was generated from the following file: