CppEphem
|
This class stores and computes information regarding the time and handles conversions to current time zone. This method is mostly intended to serve as a helper class to CEDate.
Public Member Functions | |
CETime () | |
Default constructor. More... | |
CETime (const CETime &other) | |
Copy constructor. More... | |
CETime (const double &time, CETimeType time_format=CETimeType::UTC) | |
Primary constructor. More... | |
CETime (std::vector< double > time, CETimeType time_format=CETimeType::UTC) | |
Used for setting the time from a vector where: More... | |
double | Hour (void) const |
Return the Hour associated with this time object. More... | |
double | Min (void) const |
Return the Minute associated with this time object. More... | |
CETime & | operator= (const CETime &other) |
Copy assignment operator. More... | |
double | Sec (void) const |
Return the Second associated with this time object. More... | |
void | SetHours (const double &hours) |
void | SetMinutes (const double &minutes) |
void | SetSeconds (const double &seconds) |
void | SetTime (const double &time, CETimeType time_format=CETimeType::UTC) |
Set time from double of the form HHMMSS.SS and a specified time format. More... | |
void | SetTime (std::vector< double > time_vect, CETimeType time_format=CETimeType::UTC) |
Set the time from a vector and a user specified format. More... | |
virtual | ~CETime () |
Destructor. More... | |
Static Public Member Functions | |
static double | CurrentUTC () |
Get the current UTC time as seconds since midnight. More... | |
static std::vector< double > | CurrentUTC_vect () |
Get the current UTC time as a vector. More... | |
static double | SystemUTCOffset_hrs () |
static std::vector< double > | TimeDbl2Vect (const double &time) |
Convert a time formatted as HHMMSS.SS into a vector. More... | |
static double | TimeSec2Time (const double &seconds) |
Convert number of seconds since midnight to HHMMSS.S formatted double. More... | |
static std::vector< double > | TimeSec2Vect (const double &seconds) |
Convert number of seconds since midnight to HHMMSS.S formatted double. More... | |
static double | TimeVect2Dbl (std::vector< double > time) |
Convert a time formatted as HHMMSS.SS into a vector. More... | |
static double | UTC (const double &jd) |
Get the current UTC time. More... | |
static void | UTC2GAST () |
static void | UTC2LAST () |
static void | UTC2LOCALTIME () |
static std::vector< double > | UTC_vect (const double &jd) |
Get the UTC time of a given julian date as a vector. More... | |
Private Member Functions | |
void | copy_members (const CETime &other) |
Copy data members from another object of the same type. More... | |
void | free_members (void) |
Deallocate data members if necessary. More... | |
void | init_members (void) |
Initialize data members. More... | |
void | SetTime_GAST (std::vector< double > time) |
Set the time from a vector representing Greenwich Apparent Sidereal Time. More... | |
void | SetTime_LOCALTIME (std::vector< double > time) |
Set the time from a vector representing local observer time. More... | |
void | SetTime_LST (std::vector< double > time) |
Set the time from a vector representing Local Sidereal Time. More... | |
void | SetTime_UTC (std::vector< double > time) |
Set the time from a vector representing UTC time. More... | |
Private Attributes | |
std::vector< double > | time_ |
CETimeType | time_type_ |
#include <CETime.h>
CETime::CETime | ( | ) |
Default constructor.
Definition at line 38 of file CETime.cpp.
CETime::CETime | ( | const double & | time, |
CETimeType | time_format = CETimeType::UTC |
||
) |
Primary constructor.
time | Time from a HHMMSS.S formatted double |
time_format | Specifies what type is represented by 'time' (see CETimeType) |
Definition at line 49 of file CETime.cpp.
CETime::CETime | ( | std::vector< double > | time, |
CETimeType | time_format = CETimeType::UTC |
||
) |
Used for setting the time from a vector where:
time | vector specifying the time
|
time_format | Specifies what type is represented by 'time' (see CETimeType) |
Definition at line 67 of file CETime.cpp.
CETime::CETime | ( | const CETime & | other | ) |
|
virtual |
Destructor.
Definition at line 96 of file CETime.cpp.
|
private |
Copy data members from another object of the same type.
[in] | other | CETime object to copy from |
Definition at line 340 of file CETime.cpp.
|
static |
Get the current UTC time as seconds since midnight.
Definition at line 124 of file CETime.cpp.
|
static |
Get the current UTC time as a vector.
Definition at line 157 of file CETime.cpp.
|
private |
Deallocate data members if necessary.
Definition at line 361 of file CETime.cpp.
|
inline |
|
private |
Initialize data members.
Definition at line 350 of file CETime.cpp.
|
inline |
Copy assignment operator.
[in] | other | CETime object to be copied |
Definition at line 108 of file CETime.cpp.
|
inline |
void CETime::SetTime | ( | const double & | time, |
CETimeType | time_format = CETimeType::UTC |
||
) |
Set time from double of the form HHMMSS.SS and a specified time format.
time | HHMMSS.SS formated time variable |
Definition at line 194 of file CETime.cpp.
void CETime::SetTime | ( | std::vector< double > | time_vect, |
CETimeType | time_format = CETimeType::UTC |
||
) |
Set the time from a vector and a user specified format.
time_vect | vector specifying the time
|
time_format | Specifies what type is represented by 'time' (see CETimeType) |
Definition at line 213 of file CETime.cpp.
|
private |
Set the time from a vector representing Greenwich Apparent Sidereal Time.
The elements are as follows: [0]=hours, [1]=minutes, [2]=whole seconds, [3]=fractional seconds
Definition at line 383 of file CETime.cpp.
|
private |
Set the time from a vector representing local observer time.
The elements are as follows: [0]=hours, [1]=minutes, [2]=whole seconds, [3]=fractional seconds
Definition at line 407 of file CETime.cpp.
|
private |
Set the time from a vector representing Local Sidereal Time.
time | Vector representing LST time
|
Definition at line 397 of file CETime.cpp.
|
private |
Set the time from a vector representing UTC time.
The elements are as follows: [0]=hours, [1]=minutes, [2]=whole seconds, [3]=fractional seconds
Definition at line 371 of file CETime.cpp.
|
static |
Convert a time formatted as HHMMSS.SS into a vector.
time | Time object formatted as HHMMSS.SS |
Definition at line 277 of file CETime.cpp.
|
static |
Convert number of seconds since midnight to HHMMSS.S formatted double.
seconds | Seconds since midnight |
Definition at line 300 of file CETime.cpp.
|
static |
Convert number of seconds since midnight to HHMMSS.S formatted double.
seconds | Seconds since midnight |
Definition at line 326 of file CETime.cpp.
|
static |
Convert a time formatted as HHMMSS.SS into a vector.
time | Vector containing the various time components
|
Definition at line 260 of file CETime.cpp.
|
static |
Get the current UTC time.
mjd | Modified Julian date |
Definition at line 169 of file CETime.cpp.
|
static |
Definition at line 229 of file CETime.cpp.
|
static |
Definition at line 236 of file CETime.cpp.
|
static |
Definition at line 243 of file CETime.cpp.
|
static |
Get the UTC time of a given julian date as a vector.
mjd | Modified Julian date (with day fraction) |
Definition at line 184 of file CETime.cpp.
|
private |