casacore
|
Physical quantities within reference frame. More...
#include <Measure.h>
Public Types | |
enum | Types { N_Types, DEFAULT } |
Each derived class should have a Types enumeration, specifying the recognised frame types. More... | |
typedef void * | Convert |
Each Measure should have typedefs of the form: More... | |
Public Member Functions | |
virtual | ~Measure () |
Destructor. More... | |
virtual void | set (const MeasValue &dt)=0 |
Each Measure should have the following set functions (with appropiate MVs and Ref): More... | |
virtual Bool | putValue (const Vector< Quantum< Double > > &in)=0 |
virtual Bool | setOffset (const Measure &in)=0 |
Set the offset in the reference (False if non-matching Measure) More... | |
virtual Bool | areYou (const String &tp) const =0 |
Check the type of derived Measure entity (e.g. More... | |
virtual void | assured (const String &tp) const =0 |
All should have: Assert that we are the correct Measure type. More... | |
virtual const String & | tellMe () const =0 |
Tell me your Measure type (e.g. More... | |
virtual String | getRefString () const =0 |
Each Measure should have the following static methods to give its name (e.g. More... | |
virtual Bool | isModel () const |
Tell me if you are a pure model (e.g. More... | |
void | dummy_giveMe () const |
Each derived class should have a string-to-code translation routine for the reference type. More... | |
virtual Bool | setRefString (const String &in)=0 |
Set the reference type to the specified String. More... | |
virtual const String & | getDefaultType () const =0 |
Get the default reference type. More... | |
virtual const String * | allTypes (Int &nall, Int &nextra, const uInt *&typ) const |
Get a list of all known reference codes. More... | |
virtual void | checkTypes () const =0 |
Check if all internal tables of types (both enum and String) are complete and correct. More... | |
void | dummy_getRef () const |
Each class should have a function to return its reference: More... | |
void | dummy_getValue () const |
Each derived class should be able to get its internal value and have: More... | |
virtual const Unit & | getUnit () const =0 |
Get unit (only available if Measure generated from a Quantum, else "") More... | |
virtual const MeasValue * | getData () const =0 |
Get data pointer (used by MeasConvert) More... | |
virtual MRBase * | getRefPtr () const =0 |
Get general reference pointer. More... | |
virtual void | print (std::ostream &os) const =0 |
Print a Measure. More... | |
virtual Measure * | clone () const =0 |
Create a copy. More... | |
Static Public Member Functions | |
static uInt | giveMe (const String &in, Int N_name, const String tname[]) |
A general string checking routine to be used in derived measures. More... | |
Private Member Functions | |
void | dummy_data () const |
Each class will have the following information: Actual data. More... | |
virtual void | clear ()=0 |
Clear the measure. More... | |
Friends | |
std::ostream & | operator<< (std::ostream &os, const Measure &meas) |
Each derived class should have: More... | |
Physical quantities within reference frame.
Public interface
Measure forms the abstract base class for physical quantities within a reference frame. Examples of derived classes are:
Measure is the generic name for the more specific instances like, e.g., MEpoch, an instant in time.
A Measure has both a value (specified in some value internal to the specific Measure, in general called MVMeasure (e.g. MVEpoch)), see MeasValue for general details; and a reference type and frame specifier (see MeasRef class).
The MeasRef specifies the reference type of the value, e.g. TAI, UTC, LAST. In addition the MeasRef specifies a possible offset (e.g. the beginning of the year, or today), and, if necessary, Measures necessary for defining the absolute quantity (e.g. an MPosition on Earth for LAST), using a reference frame specifier (see MeasFrame class).
The MeasRef
class is templated, but typedefs exist (and should be used) to easily specify the correct one, e.g. MEpoch::Ref
.
A Measure can be converted from one reference frame to another (e.g. an MDirection can be converted from J2000 to apparent coordinates) by setting up a measure specific conversion engine (see MeasConvert class and below). From an input MeasRef
frame and an output MeasRef
frame it constructs a conversion functional, that can be fed values (with the () operator
).
Some conversions can, in addition to the main type (like TAI), specify details to completely describe any conversion process (e.g. the type of nutation calculation) by specifying Aipsrc keyword/value pairs.
Measures can in general be constructed from a MeasRef
and a value. The value can be expressed in the internally used units (e.g. MVEpoch for MEpoch
, MVDirection for MDirection
), or as a Quantum
, i.e. a value with a dimension (e.g. (20,"km/s")) (see Quantum class). The preferred way of construction is by using the constructor:
where the reference can be omitted, defaulting to Measure::DEFAULT
), or in simple cases (not needing additional frame information) be specified directly as a code (e.g. MEpoch::IAT
).
The value of the Measure
can be obtained by a variety of get
functions, returning in general internal or Quantum
values. The preferred way is a getValue(void)
, which returns the specific MVmeasure
value, which can then be further formatted using the appropiate MVmeasure
get() functions.
Special formatting (like hh:mm:ss.t, dd.mm.ss.t, yy/mm/dd etc) are catered for in conversion-type classes like MVAngle, MVTime.
Conversion (within a Measure type) from one reference frame to another is done by the MeasConvert class. The class is templated, but has typedefs Measure::Convert
(e.g. MEpoch::Convert) for easy, and recommended, reference.
The basic constructors for a Measure::Convert
are:
The val
is used as a model for subsequent input values into this conversion engine, including possible units; the outref
specifies the output reference frame wanted. The constructor analyses the conversion wanted, and sets up a vector of routine calls to be called in sequence for the conversion. The actual conversion is done by the () operator
.
To aid in using the raw measures, each class has also a Measure::MVType and Measure::MCType defined. They denote respectively the Measure Value class of the internal value, and the class with conversion routines.
Tip: In the member description a number of dummy routines are present; They are the only way I have found to get cxx2html to get the belonging text properly present;
Which generates the output:
To be able to specify a physical entity absolutely in any reference frame; and to be able to convert from one frame to another. E.g. Local Sidereal Time to Temps Atomic International. A templated version for the MeasRef and MeasConvert was chosen to be able to check most arguments at compile time.
typedef void* casacore::Measure::Convert |
Each derived class should have a Types
enumeration, specifying the recognised frame types.
It is formatted as:
Dummy for cxx2html
Enumerator | |
---|---|
N_Types | |
DEFAULT |
|
virtual |
Destructor.
|
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. All should have
Reimplemented in casacore::MDirection, casacore::MFrequency, casacore::MEarthMagnetic, casacore::MRadialVelocity, casacore::Muvw, casacore::MDoppler, casacore::MEpoch, casacore::MBaseline, and casacore::MPosition.
Check the type of derived Measure entity (e.g.
"Epoch")
Implemented in casacore::MeasBase< Mv, Mr >, casacore::MeasBase< MVEpoch, MeasRef< MEpoch > >, casacore::MeasBase< MVFrequency, MeasRef< MFrequency > >, casacore::MeasBase< MVEarthMagnetic, MeasRef< MEarthMagnetic > >, casacore::MeasBase< MVuvw, MeasRef< Muvw > >, casacore::MeasBase< MVPosition, MeasRef< MPosition > >, casacore::MeasBase< MVDoppler, MeasRef< MDoppler > >, casacore::MeasBase< MVRadialVelocity, MeasRef< MRadialVelocity > >, casacore::MeasBase< MVBaseline, MeasRef< MBaseline > >, and casacore::MeasBase< MVDirection, MeasRef< MDirection > >.
|
pure virtual |
All should have: Assert that we are the correct Measure type.
Each Measure should have: static void assure(const Measure &in);
Implemented in casacore::MeasBase< Mv, Mr >, casacore::MeasBase< MVEpoch, MeasRef< MEpoch > >, casacore::MeasBase< MVFrequency, MeasRef< MFrequency > >, casacore::MeasBase< MVEarthMagnetic, MeasRef< MEarthMagnetic > >, casacore::MeasBase< MVuvw, MeasRef< Muvw > >, casacore::MeasBase< MVPosition, MeasRef< MPosition > >, casacore::MeasBase< MVDoppler, MeasRef< MDoppler > >, casacore::MeasBase< MVRadialVelocity, MeasRef< MRadialVelocity > >, casacore::MeasBase< MVBaseline, MeasRef< MBaseline > >, and casacore::MeasBase< MVDirection, MeasRef< MDirection > >.
|
pure 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.
All should have
Implemented in casacore::MDirection, casacore::MFrequency, casacore::MEarthMagnetic, casacore::MRadialVelocity, casacore::Muvw, casacore::MDoppler, casacore::MEpoch, casacore::MBaseline, and casacore::MPosition.
|
privatepure virtual |
Clear the measure.
Implemented in casacore::MeasBase< Mv, Mr >, casacore::MeasBase< MVEpoch, MeasRef< MEpoch > >, casacore::MeasBase< MVFrequency, MeasRef< MFrequency > >, casacore::MeasBase< MVEarthMagnetic, MeasRef< MEarthMagnetic > >, casacore::MeasBase< MVuvw, MeasRef< Muvw > >, casacore::MeasBase< MVPosition, MeasRef< MPosition > >, casacore::MeasBase< MVDoppler, MeasRef< MDoppler > >, casacore::MeasBase< MVRadialVelocity, MeasRef< MRadialVelocity > >, casacore::MeasBase< MVBaseline, MeasRef< MBaseline > >, and casacore::MeasBase< MVDirection, MeasRef< MDirection > >.
|
pure virtual |
Create a copy.
Implemented in casacore::MDirection, casacore::MFrequency, casacore::MRadialVelocity, casacore::MEarthMagnetic, casacore::Muvw, casacore::MDoppler, casacore::MEpoch, casacore::MBaseline, and casacore::MPosition.
|
inlineprivate |
|
inline |
|
inline |
Each derived class should be able to get its internal value and have:
To get dimensioned data, each derived class should contain the appropiate one of:
|
inline |
Each derived class should have a string-to-code translation routine for the reference type.
The routine returns False if unknown String (and a default mr), else an appropiate mr reference.
Dummy for cxx2html
|
pure virtual |
Get data pointer (used by MeasConvert)
Implemented in casacore::MeasBase< Mv, Mr >, casacore::MeasBase< MVEpoch, MeasRef< MEpoch > >, casacore::MeasBase< MVFrequency, MeasRef< MFrequency > >, casacore::MeasBase< MVEarthMagnetic, MeasRef< MEarthMagnetic > >, casacore::MeasBase< MVuvw, MeasRef< Muvw > >, casacore::MeasBase< MVPosition, MeasRef< MPosition > >, casacore::MeasBase< MVDoppler, MeasRef< MDoppler > >, casacore::MeasBase< MVRadialVelocity, MeasRef< MRadialVelocity > >, casacore::MeasBase< MVBaseline, MeasRef< MBaseline > >, and casacore::MeasBase< MVDirection, MeasRef< MDirection > >.
|
pure virtual |
Get the default reference type.
Implemented in casacore::MDirection, casacore::MFrequency, casacore::MEarthMagnetic, casacore::MRadialVelocity, casacore::Muvw, casacore::MDoppler, casacore::MEpoch, casacore::MBaseline, and casacore::MPosition.
|
pure virtual |
Get general reference pointer.
Implemented in casacore::MeasBase< Mv, Mr >, casacore::MeasBase< MVEpoch, MeasRef< MEpoch > >, casacore::MeasBase< MVFrequency, MeasRef< MFrequency > >, casacore::MeasBase< MVEarthMagnetic, MeasRef< MEarthMagnetic > >, casacore::MeasBase< MVuvw, MeasRef< Muvw > >, casacore::MeasBase< MVPosition, MeasRef< MPosition > >, casacore::MeasBase< MVDoppler, MeasRef< MDoppler > >, casacore::MeasBase< MVRadialVelocity, MeasRef< MRadialVelocity > >, casacore::MeasBase< MVBaseline, MeasRef< MBaseline > >, and casacore::MeasBase< MVDirection, MeasRef< MDirection > >.
|
pure virtual |
Each Measure should have the following static methods to give its name (e.g.
Epoch) or reference type (e.g. UTC):
Implemented in casacore::MDirection, casacore::MFrequency, casacore::MEarthMagnetic, casacore::MRadialVelocity, casacore::Muvw, casacore::MDoppler, casacore::MEpoch, casacore::MBaseline, and casacore::MPosition.
|
pure virtual |
Get unit (only available if Measure generated from a Quantum, else "")
Implemented in casacore::MeasBase< Mv, Mr >, casacore::MeasBase< MVEpoch, MeasRef< MEpoch > >, casacore::MeasBase< MVFrequency, MeasRef< MFrequency > >, casacore::MeasBase< MVEarthMagnetic, MeasRef< MEarthMagnetic > >, casacore::MeasBase< MVuvw, MeasRef< Muvw > >, casacore::MeasBase< MVPosition, MeasRef< MPosition > >, casacore::MeasBase< MVDoppler, MeasRef< MDoppler > >, casacore::MeasBase< MVRadialVelocity, MeasRef< MRadialVelocity > >, casacore::MeasBase< MVBaseline, MeasRef< MBaseline > >, and casacore::MeasBase< MVDirection, MeasRef< MDirection > >.
|
static |
A general string checking routine to be used in derived measures.
Its arguments are the string to be converted (in), an array of strings to check against (tname), and its length (N_name). The check is case insensitive and mini-max. A return value less than N_name indicates success.
|
virtual |
Tell me if you are a pure model (e.g.
a planet)
Reimplemented in casacore::MDirection, and casacore::MEarthMagnetic.
|
pure virtual |
Print a Measure.
Implemented in casacore::MeasBase< Mv, Mr >, casacore::MeasBase< MVEpoch, MeasRef< MEpoch > >, casacore::MeasBase< MVFrequency, MeasRef< MFrequency > >, casacore::MeasBase< MVEarthMagnetic, MeasRef< MEarthMagnetic > >, casacore::MeasBase< MVuvw, MeasRef< Muvw > >, casacore::MeasBase< MVPosition, MeasRef< MPosition > >, casacore::MeasBase< MVDoppler, MeasRef< MDoppler > >, casacore::MeasBase< MVRadialVelocity, MeasRef< MRadialVelocity > >, casacore::MeasBase< MVBaseline, MeasRef< MBaseline > >, and casacore::MeasBase< MVDirection, MeasRef< MDirection > >.
Implemented in casacore::MeasBase< Mv, Mr >, casacore::MeasBase< MVEpoch, MeasRef< MEpoch > >, casacore::MeasBase< MVFrequency, MeasRef< MFrequency > >, casacore::MeasBase< MVEarthMagnetic, MeasRef< MEarthMagnetic > >, casacore::MeasBase< MVuvw, MeasRef< Muvw > >, casacore::MeasBase< MVPosition, MeasRef< MPosition > >, casacore::MeasBase< MVDoppler, MeasRef< MDoppler > >, casacore::MeasBase< MVRadialVelocity, MeasRef< MRadialVelocity > >, casacore::MeasBase< MVBaseline, MeasRef< MBaseline > >, and casacore::MeasBase< MVDirection, MeasRef< MDirection > >.
|
pure virtual |
Each Measure should have the following set functions (with appropiate MVs and Ref):
Implemented in casacore::MeasBase< Mv, Mr >, casacore::MeasBase< MVEpoch, MeasRef< MEpoch > >, casacore::MeasBase< MVFrequency, MeasRef< MFrequency > >, casacore::MeasBase< MVEarthMagnetic, MeasRef< MEarthMagnetic > >, casacore::MeasBase< MVuvw, MeasRef< Muvw > >, casacore::MeasBase< MVPosition, MeasRef< MPosition > >, casacore::MeasBase< MVDoppler, MeasRef< MDoppler > >, casacore::MeasBase< MVRadialVelocity, MeasRef< MRadialVelocity > >, casacore::MeasBase< MVBaseline, MeasRef< MBaseline > >, and casacore::MeasBase< MVDirection, MeasRef< MDirection > >.
Set the offset in the reference (False if non-matching Measure)
Implemented in casacore::MDirection, casacore::MFrequency, casacore::MEarthMagnetic, casacore::MRadialVelocity, casacore::Muvw, casacore::MDoppler, casacore::MEpoch, casacore::MBaseline, and casacore::MPosition.
Set the reference type to the specified String.
False if illegal string, reference set to DEFAULT.
Implemented in casacore::MDirection, casacore::MFrequency, casacore::MEarthMagnetic, casacore::MRadialVelocity, casacore::Muvw, casacore::MDoppler, casacore::MEpoch, casacore::MBaseline, and casacore::MPosition.
|
pure virtual |
Tell me your Measure type (e.g.
"Epoch")
Implemented in casacore::MDirection, casacore::MFrequency, casacore::MEarthMagnetic, casacore::MRadialVelocity, casacore::Muvw, casacore::MDoppler, casacore::MEpoch, casacore::MBaseline, and casacore::MPosition.
|
friend |
Each derived class should have:
Output a Measure