MeasValue.h
Classes
- MeasValue -- Base class for values in a Measure (full description)
- Global Functions -- Global functions (full description)
Interface
- Public Members
- friend ostream &operator<<(ostream &os, const MeasValue &meas)
- void dummy_constr() const
- virtual ~MeasValue()
- void dummy_operator() const
- virtual uInt type() const = 0
- virtual void print(ostream &os) const = 0
- virtual MeasValue *clone() const = 0
- virtual Vector<Double> getVector() const = 0
- virtual Vector<Quantum<Double> > getRecordValue() const = 0
- virtual Vector<Quantum<Double> > getXRecordValue() const
- virtual Vector<Quantum<Double> > getTMRecordValue() const
- virtual void putVector(const Vector<Double> &in) = 0
- virtual Bool putValue(const Vector<Quantum<Double> > &in) = 0
- virtual void adjust()
- virtual void adjust(Double &val)
- virtual void readjust(Double val)
Review Status
- Reviewed By:
- tcornwel
- Date Reviewed:
- 1996/02/22
- Programs:
- Tests:
Prerequisite
Etymology
Synopsis
MeasValue forms the abstract base class for the values of quantities within
a reference frame. Examples of derived classes are:
MeasValue is the generic name for the more specific instances like, e.g.,
MVEpoch, an instant in time.
MeasValues can in general be constructed from an appropiate value, or array
of values.
The value can be expressed in the internally used units (e.g.
days for time, a 3-vector for direction in space), as an array of internally
used units, or as a Quantum: a value with
appropiate units. Vector<Quantum<type> >
and Quantum<Vector<type> > can
also be used.
The value of the MeasValue can be obtained by a variety of
get functions, returning in general internal or Quantum
values. Special formatting (like hh:mm:ss.t, dd.mm.ss.t, yy/mm/dd etc)
are catered for in conversion-type classes like
MVTime, MVAngle
Note that the class is a pure virtual class. No instances can be created,
but it describes the minimum set of functions necessary in derived functions.
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 presented.
Example
See individual MV and Measure classes
Motivation
To be able to specify a physical entity appropiate for the measured
quantity.
To Do
Member Description
friend ostream &operator<<(ostream &os, const MeasValue &meas)
Output a MeasValue
Each derived class should have at least the following constructors:
MV() // some default
MV(Double) // some default or error if vector expected
MV(Vector<Double>) // with check for array number of elements
MV(Quantity)
MV(Vector<Quantity>)
MV(Quantum<Vector<Double> >
Float (or other standard type) versions could be added if appropiate.
Dummy for cxx2html
Destructor
The following operators should be present at least.
MV &operator+=(const MV &meas);
MV &operator-=(const MV &meas);
Bool operator==(const MV &meas) const;
Bool operator!=(const MV &meas) const;
Bool near(const MV &meas, Double tol = 1e-13) const;
Bool nearAbs(const MV &meas, Double tol = 1e-13) const;
Dummy for cxx2html
virtual uInt type() const = 0
Assert that we are the correct MeasValue type
Thrown Exceptions
- AipsError if wrong MeasValue type
Each Measure should have:
static void assure(const MeasValue &in);
Get the type (== Register(M*)) of derived MeasValue
virtual void print(ostream &os) const = 0
Print a MeasValue
virtual MeasValue *clone() const = 0
Clone a MeasValue
Get the internal value as a Vector<Double>.
Note that the vector could
be empty, or not be a true representation (different data sizes e.g.)
Get the internal value as a Vector<Quantity>. Usable in
records. The getXRecordValue() gets additional information for records.
The getTMRecordValue() gets the record values as deemed appropriate for
the TableMeasures.
Note that the Vectors could be empty.
virtual void putVector(const Vector<Double> &in) = 0
Set the internal value from a Vector of values (obtained in principle
with a getVector()). It will be assumed that the Vector is correctly
formatted. If Vector is too long, the remainder will be discarded.
If Vector is too short, action will depend on the individual classes,
but in general act the same way as a constructor with a short Vector.
Set the internal value if correct values and dimensions
virtual void adjust()
Some of the Measure values used need the occasional adjustments to proper
values. Examples are MVDirection (direction cosines) which have to be
normalised to a length of 1 and MEpoch (time) which have to have its
precision maintained. For others it is an effctive no-operation.
Adjust value
virtual void adjust(Double &val)
Some of the Measure values used need the occasional adjustments to proper
values. Examples are MVDirection (direction cosines) which have to be
normalised to a length of 1 and MEpoch (time) which have to have its
precision maintained. For others it is an effctive no-operation.
Adjust value and return a normalisation value
virtual void readjust(Double val)
Some of the Measure values used need the occasional adjustments to proper
values. Examples are MVDirection (direction cosines) which have to be
normalised to a length of 1 and MEpoch (time) which have to have its
precision maintained. For others it is an effctive no-operation.
Re-adjust, i.e. undo a previous adjust, with value
Interface
Private Members
- ostream &operator<<(ostream &os, const MeasValue &meas)
Member Description
ostream &operator<<(ostream &os, const MeasValue &meas)
Output declaration