asdm::ArrayTime Class Reference

#include <ArrayTime.h>

Inheritance diagram for asdm::ArrayTime:

Inheritance graph
[legend]
Collaboration diagram for asdm::ArrayTime:

Collaboration graph
[legend]
List of all members.

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 93 of file ArrayTime.h.

Public Member Functions

 ArrayTime ()
 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)
 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 (EndianISStream &eiss)
 Read the binary representation of an ArrayTime from a EndianISStream and use the read value to set an ArrayTime.
static vector< ArrayTimefrom1DBin (EndianISStream &eiss)
 Read the binary representation of a vector of ArrayTime from an EndianISStream and use the read value to set a vector of ArrayTime.
static vector< vector< ArrayTime > > from2DBin (EndianISStream &eiss)
 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.
static vector< vector< vector<
ArrayTime > > > 
from3DBin (EndianISStream &eiss)
 Read the binary representation of a vector of vector of vector of ArrayTime from an EndianISStream and use the read value to set a vector of vector of vector of ArrayTime.
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
 Useful constants.
static const long long unitsInASecond
static const long long unitsInADayL
static const double unitsInADay
static const double unitsInADayDiv100
static const double julianDayOfBase
static const long long julianDayOfBaseInUnitsInADayDiv100

Private Member Functions

long long FITSString (string t) const

Static Private Member Functions

static long long init (int year, int month, double day)
static long long init (int year, int month, int day, int hour, int minute, double second)

Static Private Attributes

static const UTCCorrectionUTCCorrectionTable
static const UTCCorrection UTCLast


Constructor & Destructor Documentation

asdm::ArrayTime::ArrayTime (  ) 

asdm::ArrayTime::ArrayTime ( const string &  s  ) 

asdm::ArrayTime::ArrayTime ( const ArrayTime t  ) 

asdm::ArrayTime::ArrayTime ( const IDLArrayTime &  t  ) 

asdm::ArrayTime::ArrayTime ( int  year,
int  month,
double  day 
)

asdm::ArrayTime::ArrayTime ( int  year,
int  month,
int  day,
int  hour,
int  minute,
double  second 
)

asdm::ArrayTime::ArrayTime ( double  modifiedJulianDay  ) 

asdm::ArrayTime::ArrayTime ( int  modifiedJulianDay,
double  secondsInADay 
)

asdm::ArrayTime::ArrayTime ( long long  nanoseconds  ) 


Member Function Documentation

static bool asdm::ArrayTime::isLeapYear ( int  year  )  [static]

static double asdm::ArrayTime::getMJD ( double  jd  )  [static]

Referenced by asdm::ArrayTimeInterval::getStartInMJD().

static double asdm::ArrayTime::getJD ( double  mjd  )  [static]

static ArrayTime asdm::ArrayTime::add ( const ArrayTime time,
const Interval interval 
) [static]

static ArrayTime asdm::ArrayTime::sub ( const ArrayTime time,
const Interval interval 
) [static]

static ArrayTime asdm::ArrayTime::getArrayTime ( StringTokenizer t  )  [static]

double asdm::ArrayTime::getJD (  )  const

Referenced by getJDI().

double asdm::ArrayTime::getMJD (  )  const

Referenced by getMJDI().

double asdm::ArrayTime::getJDI (  )  const [inline]

Definition at line 229 of file ArrayTime.h.

References getJD().

double asdm::ArrayTime::getMJDI (  )  const [inline]

Definition at line 230 of file ArrayTime.h.

References getMJD().

IDLArrayTime asdm::ArrayTime::toIDLArrayTime (  )  const

string asdm::ArrayTime::toFITS (  )  const

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]

Write the binary representation of a vector of ArrayTime to a EndianOSStream.

Parameters:
arrayTime the vector of ArrayTime to be written
eoss the EndianOSStream to be written to

static void asdm::ArrayTime::toBin ( const vector< vector< ArrayTime > > &  arrayTime,
EndianOSStream eoss 
) [static]

Write the binary representation of a vector of vector of ArrayTime to a EndianOSStream.

Parameters:
arrayTime the vector of vector of ArrayTime to be written
eoss the EndianOSStream to be written to

static void asdm::ArrayTime::toBin ( const vector< vector< vector< ArrayTime > > > &  arrayTime,
EndianOSStream eoss 
) [static]

Write the binary representation of a vector of vector of vector of ArrayTime to a EndianOSStream.

Parameters:
arrayTime the vector of vector of vector of ArrayTime to be written
eoss the EndianOSStream to be written to

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.

Parameters:
eiss the EndianStream to be read
Returns:
an ArrayTime

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.

Parameters:
dis the EndianISStream to be read
Returns:
a vector of ArrayTime

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.

Parameters:
eiis the EndianISStream to be read
Returns:
a vector of vector of ArrayTime

Reimplemented from asdm::Interval.

static vector<vector<vector<ArrayTime> > > asdm::ArrayTime::from3DBin ( EndianISStream eiss  )  [static]

Read the binary representation of a vector of vector of vector of ArrayTime from an EndianISStream and use the read value to set a vector of vector of vector of ArrayTime.

Parameters:
eiss the EndianISStream to be read
Returns:
a vector of vector of vector of ArrayTime

int* asdm::ArrayTime::getDateTime (  )  const

double asdm::ArrayTime::getTimeOfDay (  )  const

int asdm::ArrayTime::getDayOfWeek (  )  const

int asdm::ArrayTime::getDayOfYear (  )  const

string asdm::ArrayTime::timeOfDayToString (  )  const

double asdm::ArrayTime::getLocalSiderealTime ( double  longitudeInHours  )  const

double asdm::ArrayTime::getGreenwichMeanSiderealTime (  )  const

static double asdm::ArrayTime::unitToJD ( long long  unit  )  [static]

static double asdm::ArrayTime::unitToMJD ( long long  unit  )  [static]

static long long asdm::ArrayTime::jdToUnit ( double  jd  )  [static]

static long long asdm::ArrayTime::mjdToUnit ( double  mjd  )  [static]

static double asdm::ArrayTime::utcCorrection ( double  jd  )  [static]

static long long asdm::ArrayTime::init ( int  year,
int  month,
double  day 
) [static, private]

static long long asdm::ArrayTime::init ( int  year,
int  month,
int  day,
int  hour,
int  minute,
double  second 
) [static, private]

long long asdm::ArrayTime::FITSString ( string  t  )  const [private]


Member Data Documentation

const int asdm::ArrayTime::numberSigDigitsInASecond [static]

Useful constants.

Definition at line 98 of file ArrayTime.h.

const long long asdm::ArrayTime::unitsInASecond [static]

Definition at line 99 of file ArrayTime.h.

const long long asdm::ArrayTime::unitsInADayL [static]

Definition at line 100 of file ArrayTime.h.

const double asdm::ArrayTime::unitsInADay [static]

Definition at line 101 of file ArrayTime.h.

Referenced by asdm::ArrayTimeInterval::getDurationInDays(), and asdm::ArrayTimeInterval::setDuration().

const double asdm::ArrayTime::unitsInADayDiv100 [static]

Definition at line 102 of file ArrayTime.h.

const double asdm::ArrayTime::julianDayOfBase [static]

Definition at line 103 of file ArrayTime.h.

const long long asdm::ArrayTime::julianDayOfBaseInUnitsInADayDiv100 [static]

Definition at line 104 of file ArrayTime.h.

const UTCCorrection* asdm::ArrayTime::UTCCorrectionTable [static, private]

Definition at line 224 of file ArrayTime.h.

const UTCCorrection asdm::ArrayTime::UTCLast [static, private]

Definition at line 225 of file ArrayTime.h.


The documentation for this class was generated from the following file:
Generated on Thu Aug 27 21:23:14 2009 for NRAOCASA by  doxygen 1.5.1