lsst.astshim gf5dcc679e7+7aca86229d
Loading...
Searching...
No Matches
ast::TimeFrame Class Reference

A TimeFrame is a specialised form of one-dimensional Frame which represents various coordinate systems used to describe positions in time. More...

#include <TimeFrame.h>

Inheritance diagram for ast::TimeFrame:

Public Member Functions

 TimeFrame (std::string const &options="")
 Construct a TimeFrame.
virtual ~TimeFrame ()
 TimeFrame (TimeFrame const &)=default
 Copy constructor: make a deep copy.
 TimeFrame (TimeFrame &&)=default
TimeFrameoperator= (TimeFrame const &)=delete
TimeFrameoperator= (TimeFrame &&)=default
std::shared_ptr< TimeFramecopy () const
 Return a deep copy of this object.
double currentTime () const
 Get the current system time.
std::string getAlignTimeScale () const
 Get AlignTimeScale: time scale in which to align TimeFrames.
double getLTOffset () const
 Get LTOffset: the offset of Local Time from UTC, in hours.
double getTimeOrigin () const
 Get TimeOrigin: the zero point for TimeFrame axis values.
std::string getTimeScale () const
 Get TimeScale: the timescale used by the TimeFrame.
void setAlignTimeScale (std::string const &scale)
 Set AlignTimeScale: time scale in which to align TimeFrames.
void setLTOffset (double offset)
 Set LTOffset: the offset of Local Time from UTC, in hours.
void setTimeOrigin (double origin)
 Set TimeOrigin: the zero point for TimeFrame axis values.
void setTimeScale (std::string const &scale)
 Set TimeScale: the timescale used by the TimeFrame.

Protected Member Functions

virtual std::shared_ptr< ObjectcopyPolymorphic () const override
 TimeFrame (AstTimeFrame *rawptr)
 Construct a TimeFrame from a raw AST pointer.

Friends

class Object

Detailed Description

A TimeFrame is a specialised form of one-dimensional Frame which represents various coordinate systems used to describe positions in time.

A TimeFrame represents a moment in time as either an Modified Julian Date (MJD), a Julian Date (JD), a Besselian epoch or a Julian epoch, as determined by the System attribute. Optionally, a zero point can be specified (using attribute TimeOrigin) which results in the TimeFrame representing time offsets from the specified zero point.

Even though JD and MJD are defined as being in units of days, the TimeFrame class allows other units to be used (via the Unit attribute) on the basis of simple scalings (60 seconds = 1 minute, 60 minutes = 1 hour, 24 hours = 1 day, 365.25 days = 1 year). Likewise, Julian epochs can be described in units other than the usual years. Besselian epoch are always represented in units of (tropical) years.

The TimeScale attribute allows the time scale to be specified (that is, the physical process used to define the rate of flow of time). MJD, JD and Julian epoch can be used to represent a time in any supported time scale. However, Besselian epoch may only be used with the "TT" (Terrestrial Time) time scale. The list of supported time scales includes universal time and siderial time. Strictly, these represent angles rather than time scales, but are included in the list since they are in common use and are often thought of as time scales. When a time value is formatted it can be formated either as a simple floating point value, or as a Gregorian date (see the Format attribute).

Attributes

TimeFrame has the following attributes in addition to those provided by Frame, Mapping and Object

Several of the Frame attributes inherited by the TimeFrame class refer to a specific axis of the Frame (for instance Unit(axis), Label(axis), etc). Since a TimeFrame is strictly one-dimensional, it allows these attributes to be specified without an axis index. So for instance, "Unit" is allowed in place of "Unit(1)".

Definition at line 80 of file TimeFrame.h.

Constructor & Destructor Documentation

◆ TimeFrame() [1/4]

ast::TimeFrame::TimeFrame ( std::string const & options = "")
inlineexplicit

Construct a TimeFrame.

Parameters
[in]optionsComma-separated list of attribute assignments.

Definition at line 89 of file TimeFrame.h.

◆ ~TimeFrame()

virtual ast::TimeFrame::~TimeFrame ( )
inlinevirtual

Definition at line 94 of file TimeFrame.h.

◆ TimeFrame() [2/4]

ast::TimeFrame::TimeFrame ( TimeFrame const & )
default

Copy constructor: make a deep copy.

◆ TimeFrame() [3/4]

ast::TimeFrame::TimeFrame ( TimeFrame && )
default

◆ TimeFrame() [4/4]

ast::TimeFrame::TimeFrame ( AstTimeFrame * rawptr)
inlineexplicitprotected

Construct a TimeFrame from a raw AST pointer.

Definition at line 159 of file TimeFrame.h.

Member Function Documentation

◆ copy()

std::shared_ptr< TimeFrame > ast::TimeFrame::copy ( ) const
inline

Return a deep copy of this object.

Definition at line 103 of file TimeFrame.h.

◆ copyPolymorphic()

virtual std::shared_ptr< Object > ast::TimeFrame::copyPolymorphic ( ) const
inlineoverrideprotectedvirtual

Definition at line 154 of file TimeFrame.h.

◆ currentTime()

double ast::TimeFrame::currentTime ( ) const
inline

Get the current system time.

Returns
the current system time, as specified by the frame's attributes System, TimeOrigin, LTOffset, TimeScale, and Unit.
Exceptions
std::runtime_errorif the frame has a TimeScale value which cannot be converted to TAI (e.g. " angular" systems such as UT1, GMST, LMST and LAST).

Notes:

  • Resolution is one second.
  • This method assumes that the system time (returned by the C time() function) follows the POSIX standard, representing a continuous monotonic increasing count of SI seconds since the epoch 00:00:00 UTC 1 January 1970 AD (equivalent to TAI with a constant offset).
  • Any inaccuracy in the system clock will be reflected in the value returned by this function.

Definition at line 123 of file TimeFrame.h.

◆ getAlignTimeScale()

std::string ast::TimeFrame::getAlignTimeScale ( ) const
inline

Get AlignTimeScale: time scale in which to align TimeFrames.

Definition at line 130 of file TimeFrame.h.

◆ getLTOffset()

double ast::TimeFrame::getLTOffset ( ) const
inline

Get LTOffset: the offset of Local Time from UTC, in hours.

Definition at line 133 of file TimeFrame.h.

◆ getTimeOrigin()

double ast::TimeFrame::getTimeOrigin ( ) const
inline

Get TimeOrigin: the zero point for TimeFrame axis values.

Definition at line 136 of file TimeFrame.h.

◆ getTimeScale()

std::string ast::TimeFrame::getTimeScale ( ) const
inline

Get TimeScale: the timescale used by the TimeFrame.

Definition at line 139 of file TimeFrame.h.

◆ operator=() [1/2]

TimeFrame & ast::TimeFrame::operator= ( TimeFrame && )
default

◆ operator=() [2/2]

TimeFrame & ast::TimeFrame::operator= ( TimeFrame const & )
delete

◆ setAlignTimeScale()

void ast::TimeFrame::setAlignTimeScale ( std::string const & scale)
inline

Set AlignTimeScale: time scale in which to align TimeFrames.

Definition at line 142 of file TimeFrame.h.

◆ setLTOffset()

void ast::TimeFrame::setLTOffset ( double offset)
inline

Set LTOffset: the offset of Local Time from UTC, in hours.

Definition at line 145 of file TimeFrame.h.

◆ setTimeOrigin()

void ast::TimeFrame::setTimeOrigin ( double origin)
inline

Set TimeOrigin: the zero point for TimeFrame axis values.

Definition at line 148 of file TimeFrame.h.

◆ setTimeScale()

void ast::TimeFrame::setTimeScale ( std::string const & scale)
inline

Set TimeScale: the timescale used by the TimeFrame.

Definition at line 151 of file TimeFrame.h.

◆ Object

friend class Object
friend

Definition at line 81 of file TimeFrame.h.


The documentation for this class was generated from the following file: