casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Types | Public Member Functions | Static Public Member Functions | Friends
casa::MEpoch Class Reference

A Measure: instant in time. More...

#include <MEpoch.h>

Inheritance diagram for casa::MEpoch:
casa::MeasBase< MVEpoch, MeasRef< MEpoch > > casa::Measure

List of all members.

Public Types

enum  Types {
  LAST,
  LMST,
  GMST1,
  GAST,
  UT1,
  UT2,
  UTC,
  TAI,
  TDT,
  TCG,
  TDB,
  TCB,
  N_Types,
  RAZE,
  EXTRA,
  IAT,
  GMST,
  TT,
  UT,
  ET,
  DEFAULT
}
 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();
More...
typedef MVEpoch MVType
 Measure value container for this class (i.e.
typedef MCEpoch MCType
 Measure conversion routines for this class (i.e.
typedef MeasRef< MEpochRef
 Measure reference (i.e.
typedef MeasConvert< MEpochConvert
 Measure Convert (i.e.
typedef ScalarMeasColumn< MEpochScalarColumn
 Measure table Columns (e.g., MEpoch::ScalarColumn)
typedef ArrayMeasColumn< MEpochArrayColumn

Public Member Functions

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)
 Create from data and reference.
 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 StringtellMe () const
 Tell me your type.
virtual uInt type () const
 Get the type (== Register() of derived Measure (faster than Strings) All should have: static uInt myType();.
Bool giveMe (MEpoch::Ref &mr, const String &in)
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.
virtual const StringgetDefaultType () const
 Get the default reference type.
virtual const StringallTypes (Int &nall, Int &nextra, const uInt *&typ) const
 Get a list of all known reference codes.
virtual void checkTypes () const
 Check if all internal tables of types (both enum and String) are complete and correct.
virtual String getRefString () const
 Get the reference type (for records, including codes like R_)
Quantity get (const Unit &inunit) const
 Get time in specified units.
virtual Measureclone () const
 Create copy.

Static Public Member Functions

static const StringshowMe ()
static void assure (const Measure &in)
static MEpoch::Types castType (uInt tp)
 Translate reference code.
static const StringshowType (MEpoch::Types tp)
static const StringshowType (uInt tp)
static Bool getType (MEpoch::Types &tp, const String &in)
 Translate string to reference code.
static const StringallMyTypes (Int &nall, Int &nextra, const uInt *&typ)
static void checkMyTypes ()
static uInt myType ()
 Get my type (as Register)

Friends

class MeasConvert< MEpoch >

Detailed Description

A Measure: instant in time.

Intended use:

Public interface

Review Status

Reviewed By:
UNKNOWN
Date Reviewed:
before2004/08/25
Test programs:
tMeasure

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>
        #include <measures/Measures/MCEpoch.h>
         #include <casa/logging/LogIO.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;
         LogIO os(LogOrigin("FluxCalc_SS_JPL_Butler", "readEphem"));
         os << LogIO::DEBUG1 << " at ";
         os.output() << MEpoch::Convert(MEpoch(MVEpoch(Quantity(50237.29, "d")),
                                       MEpoch::Ref(MEpoch::UTC)),
                                MEpoch::Ref(MEpoch::TAI))();
         os << LogIO::POST;

Results in:

        TAI for UTC = MJD(50237.29): Epoch: 50237::06:58:06.0000 (on stdout)
          at Epoch: 50237::06:58:06.0000 (in logger)

Motivation

To Do

Definition at line 104 of file MEpoch.h.


Member Typedef Documentation

Definition at line 161 of file MEpoch.h.

Measure Convert (i.e.

MEpoch::Convert)

Reimplemented from casa::Measure.

Definition at line 158 of file MEpoch.h.

Measure conversion routines for this class (i.e.

MEpoch::MCType)

Definition at line 154 of file MEpoch.h.

Measure value container for this class (i.e.

MEpoch::MVType)

Definition at line 152 of file MEpoch.h.

Measure reference (i.e.

MEpoch::Ref)

Definition at line 156 of file MEpoch.h.

Measure table Columns (e.g., MEpoch::ScalarColumn)

Definition at line 160 of file MEpoch.h.


Member Enumeration Documentation

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();

Enumerator:
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 

Reduce result to integer days.

EXTRA 

All extra bits.

IAT 

Synonyms.

GMST 
TT 
UT 
ET 
DEFAULT 

Default.

Reimplemented from casa::Measure.

Definition at line 117 of file MEpoch.h.


Constructor & Destructor Documentation


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

casa::MEpoch::MEpoch ( const MVEpoch dt)

Create from data and reference.

casa::MEpoch::MEpoch ( const MVEpoch dt,
const MEpoch::Ref rf 
)
casa::MEpoch::MEpoch ( const MVEpoch dt,
MEpoch::Types  rf 
)
casa::MEpoch::MEpoch ( const Quantity dt)
casa::MEpoch::MEpoch ( const Quantity dt,
const MEpoch::Ref rf 
)
casa::MEpoch::MEpoch ( const Quantity dt,
MEpoch::Types  rf 
)
casa::MEpoch::MEpoch ( const Measure dt)
virtual casa::MEpoch::~MEpoch ( ) [virtual]

    


Member Function Documentation

static const String* casa::MEpoch::allMyTypes ( Int nall,
Int nextra,
const uInt *&  typ 
) [static]
virtual const String* casa::MEpoch::allTypes ( Int nall,
Int nextra,
const uInt *&  typ 
) const [virtual]

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.

Reimplemented from casa::Measure.

static void casa::MEpoch::assure ( const Measure in) [static]
static MEpoch::Types casa::MEpoch::castType ( uInt  tp) [static]

Translate reference code.

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

Thrown Exceptions

  • AipsError in the uInt interface if illegal code given
static void casa::MEpoch::checkMyTypes ( ) [static]
virtual void casa::MEpoch::checkTypes ( ) const [virtual]

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

  • AipsError if a (programming) error in the types.

Implements casa::Measure.

virtual Measure* casa::MEpoch::clone ( ) const [virtual]

Create copy.

Implements casa::Measure.

Quantity casa::MEpoch::get ( const Unit inunit) const

Get time in specified units.

virtual const String& casa::MEpoch::getDefaultType ( ) const [virtual]

Get the default reference type.

Implements casa::Measure.

virtual String casa::MEpoch::getRefString ( ) const [virtual]

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

Implements casa::Measure.

static Bool casa::MEpoch::getType ( MEpoch::Types tp,
const String in 
) [static]

Translate string to reference code.

Bool casa::MEpoch::giveMe ( MEpoch::Ref mr,
const String in 
)
static uInt casa::MEpoch::myType ( ) [static]

Get my type (as Register)

virtual Bool casa::MEpoch::setOffset ( const Measure in) [virtual]

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

Implements casa::Measure.

virtual Bool casa::MEpoch::setRefString ( const String in) [virtual]

Set the reference type to the specified String.

False if illegal string, reference set to DEFAULT.

Implements casa::Measure.

static const String& casa::MEpoch::showMe ( ) [static]
static const String& casa::MEpoch::showType ( MEpoch::Types  tp) [static]
static const String& casa::MEpoch::showType ( uInt  tp) [static]
virtual const String& casa::MEpoch::tellMe ( ) const [virtual]

Tell me your type.

Implements casa::Measure.

virtual uInt casa::MEpoch::type ( ) const [virtual]

Get the type (== Register() of derived Measure (faster than Strings) All should have: static uInt myType();.

Implements casa::Measure.

Reference enum Types (included originally for gcc 2.95)


Friends And Related Function Documentation

friend class MeasConvert< MEpoch > [friend]

Definition at line 108 of file MEpoch.h.


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