MVRadialVelocity.h

Classes

MVRadialVelocity -- Internal value for MRadialVelocity (full description)

class MVRadialVelocity : public MeasValue

Interface

Public Members
MVRadialVelocity()
MVRadialVelocity(const MVRadialVelocity &other)
MVRadialVelocity &operator=(const MVRadialVelocity &other)
MVRadialVelocity(Double d)
MVRadialVelocity(const Quantity &other)
MVRadialVelocity(const Quantum<Vector<Double> > &other)
MVRadialVelocity(const Vector<Double> &other)
MVRadialVelocity(const Vector<Quantity> &other)
~MVRadialVelocity()
operator Double() const
MVRadialVelocity &operator+=(const MVRadialVelocity &other)
MVRadialVelocity &operator-=(const MVRadialVelocity &other)
Bool operator==(const MVRadialVelocity &other) const
Bool operator!=(const MVRadialVelocity &other) const
Bool near(const MVRadialVelocity &other, Double tol = 1e-13) const
Bool nearAbs(const MVRadialVelocity &other, Double tol = 1e-13) const
virtual uInt type() const
static void assure(const MeasValue &in)
virtual void print(ostream &os) const
virtual MeasValue *clone() const
Double getValue() const
Quantity get() const
Quantity get(const Unit &unit) const
virtual Vector<Double> getVector() const
virtual void putVector(const Vector<Double> &in)
virtual Vector<Quantum<Double> > getRecordValue() const
virtual Bool putValue(const Vector<Quantum<Double> > &in)
Vector<Double> shiftFrequency(const Vector<Double> &freq) const
Quantum<Vector<Double> > shiftFrequency(const Quantum<Vector<Double> > &freq) const
Private Members
Double makeF(const Unit &dt) const

Description

Review Status

Reviewed By:
tcornwel
Date Reviewed:
1996/02/23
Programs:
Tests:

Prerequisite

Etymology

From Measure, Value and Radial Velocity

Synopsis

An MVRadialVelocity is a simple Double, to be used in the MRadialVelocity measure. Requirements can be found in the MeasValue base class.
The only reasonable constructor is (but all MeasValue constructors are present) MVRadialVelocity(Double); and an operator Double takes care of all other possibilities. Its external use is for MeasConvert, to distinguish between input in internal Measure units, and values which have to have units applied.
The MVRadialVelocity(Quantum) constructors recognise the type of wave characteristics presented from its units. Recognised are:
The velocity is returned in m/s with getValue(); or as a Quantity in m/s with get(); or in the specified units with get(unit).

A shiftFrequency() method can shift frequencies.

Example

See MRadialVelocity

Motivation

To aid coordinate transformations possibilities

To Do

Member Description

MVRadialVelocity()

Default constructor: generate a zero value

MVRadialVelocity(const MVRadialVelocity &other)

Copy constructor

MVRadialVelocity &operator=(const MVRadialVelocity &other)

Copy assignment

MVRadialVelocity(Double d)

Constructor from Double (assume m/s)

MVRadialVelocity(const Quantity &other)
MVRadialVelocity(const Quantum<Vector<Double> > &other)

Constructor from Quantum

MVRadialVelocity(const Vector<Double> &other)
MVRadialVelocity(const Vector<Quantity> &other)

Constructor from Vector. A zero value will be taken for an empty vector, the first element for a quantum vector.

Thrown Exceptions

~MVRadialVelocity()

Destructor

operator Double() const

Conversion operator

MVRadialVelocity &operator+=(const MVRadialVelocity &other)
MVRadialVelocity &operator-=(const MVRadialVelocity &other)

Addition

Bool operator==(const MVRadialVelocity &other) const
Bool operator!=(const MVRadialVelocity &other) const
Bool near(const MVRadialVelocity &other, Double tol = 1e-13) const
Bool nearAbs(const MVRadialVelocity &other, Double tol = 1e-13) const

Comparisons

virtual uInt type() const
static void assure(const MeasValue &in)

Tell me your type

virtual void print(ostream &os) const

Print data

virtual MeasValue *clone() const

Clone

Double getValue() const

Adjust value: taken from base class, a NOP. Get value in m/s

Quantity get() const

Get quantity in m/s

Quantity get(const Unit &unit) const

Get the wave characteristics in (recognised) specified units

virtual Vector<Double> getVector() const

Get the value in internal units

virtual void putVector(const Vector<Double> &in)

Set the value from internal units (set 0 for empty vector)

virtual Vector<Quantum<Double> > getRecordValue() const

Get the internal value as a Vector<Quantity>. Usable in records. The getXRecordValue() gets additional information for records. Note that the Vectors could be empty.

virtual Bool putValue(const Vector<Quantum<Double> > &in)

Set the internal value if correct values and dimensions

Vector<Double> shiftFrequency(const Vector<Double> &freq) const
Quantum<Vector<Double> > shiftFrequency(const Quantum<Vector<Double> > &freq) const

Shift the input frequencies to the output frequencies. In the case of simple Double inputs, it is assumed that the values are linearly dependent on frequency. I.e. frequencies given as wavelength or time cannot be used.

Double makeF(const Unit &dt) const

Get correct data type conversion factor from input Quantum