casa
5.7.0-16
|
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>
Public Member Functions | |
ArrayTime () | |
The nullary constructor. More... | |
ArrayTime (const std::string &s) | |
Builds an ArrayTime out of the content of a string. More... | |
ArrayTime (const ArrayTime &t) | |
The copy constructor. More... | |
ArrayTime (const asdmIDLTypes::IDLArrayTime &t) | |
Builds an ArrayTime from the CORBA/IDL representation of an ArrayTime. More... | |
ArrayTime (int year, int month, double day) | |
Builds an ArrayTime from a triple (year, month, day). More... | |
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. More... | |
ArrayTime (double modifiedJulianDay) | |
Build an ArrayTime from an MJD date. More... | |
ArrayTime (int modifiedJulianDay, double secondsInADay) | |
Build an ArrayTime from an MJD date. More... | |
ArrayTime (int64_t nanoseconds) | |
Build an ArrayTime from a number of nanoseconds. More... | |
double | getJD () const |
Return the julian day. More... | |
double | getMJD () const |
Return the modified julian day. More... | |
asdmIDLTypes::IDLArrayTime | toIDLArrayTime () const |
std::string | toFITS () const |
void | toBin (EndianOSStream &eoss) |
Write the binary representation of this to a EndianOSStream. More... | |
int * | getDateTime () const |
double | getTimeOfDay () const |
int | getDayOfWeek () const |
int | getDayOfYear () const |
std::string | timeOfDayToString () const |
double | getLocalSiderealTime (double longitudeInHours) const |
double | getGreenwichMeanSiderealTime () const |
Public Member Functions inherited from asdm::Interval | |
Interval () | |
Interval constructors. More... | |
Interval (const Interval &) | |
Interval (const std::string &s) | |
Interval (const asdmIDLTypes::IDLInterval &) | |
Interval (int64_t value) | |
virtual | ~Interval () |
Interval destructor. More... | |
Interval & | operator= (const Interval &) |
assignment operator More... | |
Interval & | operator= (const int64_t) |
assignment operator More... | |
Interval & | operator+= (const Interval &) |
assignment with arithmetic operators More... | |
Interval & | operator-= (const Interval &) |
Interval & | operator*= (const int64_t) |
Interval & | operator/= (const int64_t) |
Interval | operator+ (const Interval &) const |
arithmetic functions More... | |
Interval | operator- (const Interval &) const |
Interval | operator* (const int64_t) const |
Interval | operator/ (const int64_t) const |
bool | operator< (const Interval &) const |
comparison operators More... | |
bool | operator> (const Interval &) const |
bool | operator<= (const Interval &) const |
bool | operator>= (const Interval &) const |
bool | operator== (const Interval &) const |
bool | equals (const Interval &) const |
bool | operator!= (const Interval &) const |
bool | isZero () const |
Interval | operator- () const |
unary - and + operators More... | |
Interval | operator+ () const |
std::string | toString () const |
std::string | toStringI () const |
void | toBin (EndianOSStream &eoss) |
Write the binary representation of this into an EndianOSStream. More... | |
operator std::string () const | |
Conversion functions. More... | |
int64_t | get () const |
asdmIDLTypes::IDLInterval | toIDLInterval () 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 std::vector< ArrayTime > &arrayTime, EndianOSStream &eoss) |
Write the binary representation of a vector of ArrayTime to a EndianOSStream. More... | |
static void | toBin (const std::vector< std::vector< ArrayTime > > &arrayTime, EndianOSStream &eoss) |
Write the binary representation of a vector of vector of ArrayTime to a EndianOSStream. More... | |
static void | toBin (const std::vector< std::vector< std::vector< ArrayTime > > > &arrayTime, EndianOSStream &eoss) |
Write the binary representation of a vector of vector of vector of ArrayTime to a EndianOSStream. More... | |
static ArrayTime | fromBin (EndianIStream &eis) |
Read the binary representation of an ArrayTime from a EndianIStream and use the read value to set an ArrayTime. More... | |
static std::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. More... | |
static std::vector < std::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. More... | |
static std::vector < std::vector< std::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. More... | |
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 Member Functions inherited from asdm::Interval | |
static int64_t | fromString (const std::string &) |
static std::string | toString (int64_t) |
static Interval | getInterval (StringTokenizer &t) throw (NumberFormatException) |
static void | toBin (std::vector< Interval > interval, EndianOSStream &eoss) |
Write the binary representation of a vector of Interval into a EndianOSStream. More... | |
static void | toBin (std::vector< std::vector< Interval > > interval, EndianOSStream &eoss) |
Write the binary representation of a vector of vector of Interval into a EndianOSStream. More... | |
static Interval | fromBin (EndianIStream &eis) |
Read the binary representation of an Interval from an EndianIStream and use the read value to set an Interval. More... | |
static std::vector< Interval > | from1DBin (EndianIStream &eis) |
Read the binary representation of a vector of Interval from a EndianIStream and use the read value to set a vector of Interval. More... | |
static std::vector < std::vector< Interval > > | from2DBin (EndianIStream &eis) |
Read the binary representation of a vector of vector of Interval from a EndianIStream and use the read value to set a vector of vector of Interval. More... | |
static std::string | unit () |
Static Public Attributes | |
static const int | numberSigDigitsInASecond |
Useful constants. More... | |
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 (std::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 |
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".
Definition at line 89 of file ArrayTime.h.
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 std::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.
s | a const reference to a string. |
asdm::ArrayTime::ArrayTime | ( | const ArrayTime & | t | ) |
The copy constructor.
s | a const reference to an ArrayTime. |
asdm::ArrayTime::ArrayTime | ( | const asdmIDLTypes::IDLArrayTime & | t | ) |
asdm::ArrayTime::ArrayTime | ( | int | year, |
int | month, | ||
double | day | ||
) |
Builds an ArrayTime from a triple (year, month, day).
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. |
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.
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]. |
InvalidArgumentException. |
asdm::ArrayTime::ArrayTime | ( | double | modifiedJulianDay | ) |
Build an ArrayTime from an MJD date.
modifieJulianDay | a value in double precision. |
asdm::ArrayTime::ArrayTime | ( | int | modifiedJulianDay, |
double | secondsInADay | ||
) |
Build an ArrayTime from an MJD date.
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.
nanoseconds | a int64_t integer value to express a number of nanoseconds since 17 November 1858 00:00:00 UTC. |
|
private |
|
static |
Read the binary representation of a vector of ArrayTime from an EndianIStream and use the read value to set a vector of ArrayTime.
dis | the EndianIStream to be read |
|
static |
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.
eiis | the EndianIStream to be read |
|
static |
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.
eis | the EndianIStream to be read |
|
static |
Read the binary representation of an ArrayTime from a EndianIStream and use the read value to set an ArrayTime.
eis | the EndianStream to be read |
|
static |
int* asdm::ArrayTime::getDateTime | ( | ) | const |
int asdm::ArrayTime::getDayOfWeek | ( | ) | const |
int asdm::ArrayTime::getDayOfYear | ( | ) | const |
double asdm::ArrayTime::getGreenwichMeanSiderealTime | ( | ) | const |
|
static |
double asdm::ArrayTime::getJD | ( | ) | const |
Return the julian day.
double asdm::ArrayTime::getLocalSiderealTime | ( | double | longitudeInHours | ) | const |
|
static |
Referenced by asdm::ArrayTimeInterval::getStartInMJD().
double asdm::ArrayTime::getMJD | ( | ) | const |
Return the modified julian day.
double asdm::ArrayTime::getTimeOfDay | ( | ) | const |
|
staticprivate |
|
staticprivate |
|
static |
|
static |
|
static |
std::string asdm::ArrayTime::timeOfDayToString | ( | ) | const |
void asdm::ArrayTime::toBin | ( | EndianOSStream & | eoss | ) |
Write the binary representation of this to a EndianOSStream.
|
static |
Write the binary representation of a vector of ArrayTime to a EndianOSStream.
arrayTime | the vector of ArrayTime to be written |
eoss | the EndianOSStream to be written to |
|
static |
Write the binary representation of a vector of vector of ArrayTime to a EndianOSStream.
arrayTime | the vector of vector of ArrayTime to be written |
eoss | the EndianOSStream to be written to |
|
static |
Write the binary representation of a vector of vector of vector of ArrayTime to a EndianOSStream.
arrayTime | the vector of vector of vector of ArrayTime to be written |
eoss | the EndianOSStream to be written to |
std::string asdm::ArrayTime::toFITS | ( | ) | const |
asdmIDLTypes::IDLArrayTime asdm::ArrayTime::toIDLArrayTime | ( | ) | const |
|
static |
|
static |
|
static |
|
static |
Definition at line 99 of file ArrayTime.h.
|
static |
Definition at line 100 of file ArrayTime.h.
|
static |
Useful constants.
Definition at line 94 of file ArrayTime.h.
|
static |
Definition at line 97 of file ArrayTime.h.
Referenced by asdm::ArrayTimeInterval::getDurationInDays(), and asdm::ArrayTimeInterval::setDuration().
|
static |
Definition at line 98 of file ArrayTime.h.
|
static |
Definition at line 96 of file ArrayTime.h.
|
static |
Definition at line 95 of file ArrayTime.h.
Referenced by casa::MS2ASDM::ASDMArrayTime(), casa::MS2ASDM::ASDMInterval(), asdm::ASDM_TABLE_BASE::ati2CASA1D(), asdm::ASDM_TABLE_BASE::ati2CASA2D(), asdm::ASDM_TABLE_BASE::ati2CASA3D(), and casa::MS2ASDM::MSTimeSecs().
|
staticprivate |
Definition at line 307 of file ArrayTime.h.
|
staticprivate |
Definition at line 308 of file ArrayTime.h.