MEpoch.h

Classes

MEpoch -- A Measure: instant in time (full description)

class MEpoch : public MeasBase<MVEpoch, MeasRef<MEpoch> >

Types

enum Types

LAST
Local Apparent Sidereal Time
LMST
Local Mean Sidereal Time
GMST1
Greenwich Mean ST1
GAST
Greenwich Apparent ST
UT1
UT2
UTC
TAI
TDT
TCG
TDB
TCB
N_Types
Number of types
RAZE = 32
Reduce result to integer days
EXTRA = RAZE,
All extra bits
IAT = TAI,GMST=GMST1,TT=TDT,UT=UT1,ET=TT,
Synonyms Synonyms
DEFAULT = UTC
Default Default

Interface

Public Members
typedef WHATEVER_SUN_TYPEDEF(MEpoch) Types Types
MEpoch()
MEpoch(const MVEpoch &dt)
MEpoch(const MVEpoch &dt, const MEpoch::Ref &rf)
MEpoch(const MVEpoch &dt, MEpoch::Types rf)
MEpoch(const Quantity &dt)
MEpoch(const Quantity &dt, const MEpoch::Ref &rf)
MEpoch(const Quantity &dt, MEpoch::Types rf)
MEpoch(const Measure *dt)
MEpoch(const MeasValue *dt)
virtual ~MEpoch()
virtual const String &tellMe() const
static const String &showMe()
virtual uInt type() const
static void assure(const Measure &in)
static MEpoch::Types castType(uInt tp)
static const String &showType(MEpoch::Types tp)
static const String &showType(uInt tp)
static Bool getType(MEpoch::Types &tp, const String &in)
Bool giveMe(MEpoch::Ref &mr, const String &in)
virtual Bool setOffset(const Measure &in)
virtual Bool setRefString(const String &in)
virtual const String &getDefaultType() const
virtual const String *const allTypes(Int &nall, Int &nextra, const uInt *&typ) const
static const String *const allMyTypes(Int &nall, Int &nextra, const uInt *&typ)
virtual void checkTypes() const
static void checkMyTypes()
virtual String getRefString() const
static uInt myType()
Quantity get(const Unit &inunit) const
virtual Measure *clone() const

Description

Review Status

Reviewed By:
UNKNOWN
Date Reviewed:
before2004/08/25
Programs:
Tests:

Prerequisite

Etymology

Measure and Epoch

Synopsis

MEpoch forms derived Measure class for an instant in time.

Example

Convert (with all steps explicit) a UTC to an IAT time.
	#include <measures/Measures.h>
	#include <measures/Measures/MEpoch.h>
	cout << "TAI for UTC = MJD(50237.29): " <<
		MEpoch::Convert(MEpoch(MVEpoch(Quantity(50237.29, "d")),
			               MEpoch::Ref(MEpoch::UTC)),
		                MEpoch::Ref(MEpoch::TAI))() <<
		endl;
Results in:
	TAI for UTC = MJD(50237.29): Epoch: 50237::06:58:06.0000

Motivation

To Do

Member Description

enum Types

Types of known MEpochs

Caution The order defines the order in the translation matrix in the MCEpoch class. Do not change the order without changing the array. Additions should be made before N_types, and an additional row and column should be coded in FromTo (MCEpoch), and in showType().

typedef WHATEVER_SUN_TYPEDEF(MEpoch) Types Types

Reference enum Types (included originally for gcc 2.95)

MEpoch()

Tip In the following constructors and other functions, all MeasRef can be replaced with simple Measure::TYPE where no offsets or frames are needed in the reference.
Default constructor; generates an instant at MJD 0 UTC

MEpoch(const MVEpoch &dt)
MEpoch(const MVEpoch &dt, const MEpoch::Ref &rf)
MEpoch(const MVEpoch &dt, MEpoch::Types rf)
MEpoch(const Quantity &dt)
MEpoch(const Quantity &dt, const MEpoch::Ref &rf)
MEpoch(const Quantity &dt, MEpoch::Types rf)
MEpoch(const Measure *dt)
MEpoch(const MeasValue *dt)

Create from data and reference

virtual ~MEpoch()

virtual const String &tellMe() const
static const String &showMe()
virtual uInt type() const
static void assure(const Measure &in)

Tell me your type

static MEpoch::Types castType(uInt tp)
static const String &showType(MEpoch::Types tp)
static const String &showType(uInt tp)

Translate reference code. The uInt version has a check for valid codes (i.e. it is a safe cast).

Thrown Exceptions

static Bool getType(MEpoch::Types &tp, const String &in)
Bool giveMe(MEpoch::Ref &mr, const String &in)

Translate string to reference code

virtual Bool setOffset(const Measure &in)

Set the offset in the reference (False if non-matching Measure)

virtual Bool setRefString(const String &in)

Set the reference type to the specified String. False if illegal string, reference set to DEFAULT.

virtual const String &getDefaultType() const

Get the default reference type

virtual const String *const allTypes(Int &nall, Int &nextra, const uInt *&typ) const
static const String *const allMyTypes(Int &nall, Int &nextra, const uInt *&typ)

Get a list of all known reference codes. nall returns the number in list, nextra the number of specials (like planets) that should be at end of list). typ returns the list of corresponding types.

virtual void checkTypes() const
static void checkMyTypes()

Check if all internal tables of types (both enum and String) are complete and correct. This function is called automatically if and when necessary.

Thrown Exceptions

virtual String getRefString() const

Get the reference type (for records, including codes like R_)

static uInt myType()

Get my type (as Register)

Quantity get(const Unit &inunit) const

Get time in specified units

virtual Measure *clone() const

Create copy