MVFrequency.h
Classes
- MVFrequency -- Internal value for MFrequency (full description)
Interface
- Public Members
- MVFrequency()
- MVFrequency(const MVFrequency &other)
- MVFrequency &operator=(const MVFrequency &other)
- MVFrequency(Double d)
- MVFrequency(const Quantity &other)
- MVFrequency(const Quantum<Vector<Double> > &other)
- MVFrequency(const Vector<Double> &other)
- MVFrequency(const Vector<Quantity> &other)
- ~MVFrequency()
- operator Double() const
- MVFrequency &operator+=(const MVFrequency &other)
- MVFrequency &operator-=(const MVFrequency &other)
- Bool operator==(const MVFrequency &other) const
- Bool operator!=(const MVFrequency &other) const
- Bool near(const MVFrequency &other, Double tol = 1e-13) const
- Bool nearAbs(const MVFrequency &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)
- Private Members
- Double makeF(Double v, const Unit &dt, Bool rev=False) const
Review Status
- Reviewed By:
- tcornwel
- Date Reviewed:
- 1996/02/23
- Programs:
- Tests:
Prerequisite
Etymology
From Measure, Value and Frequency
Synopsis
An MVFrequency is a simple Double, to be used in the MFrequency measure.
Requirements can be found in the
MeasValue base class.
The only reasonable constructor is (but all MeasValue constructors are
present)
MVFrequency(Double) (with assumed Hz units);
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 MVFrequency(Quantum) constructors recognise the type of wave
characteristics presented from its units. Recognised are:
- frequency (1/time)
- time
- angle/time
- wavelength
- 1/wavelength (in 2pi units)
- energy (h.nu)
- impulse
The frequency is returned in Hz with getValue(); or as a Quantity
in Hz with get(); or in one of the above units with get(unit).
Example
See MFrequency
Motivation
To aid coordinate transformations possibilities
To Do
Member Description
Default constructor: generate a zero value
MVFrequency(const MVFrequency &other)
Copy constructor
MVFrequency &operator=(const MVFrequency &other)
Copy assignment
Constructor from Double, assuming Hz
Constructor from Quantum : value taken will be the canonical value
Constructor from Vector. A zero value will be taken for an empty vector,
the canonical value for a quantum vector.
Thrown Exceptions
- AipsError if vector length > 1
Destructor
operator Double() const
Conversion operator
MVFrequency &operator+=(const MVFrequency &other)
MVFrequency &operator-=(const MVFrequency &other)
Addition
Bool operator==(const MVFrequency &other) const
Bool operator!=(const MVFrequency &other) const
Bool near(const MVFrequency &other, Double tol = 1e-13) const
Bool nearAbs(const MVFrequency &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
Clone
Adjust value: taken from base class, a NOP.
Get value in Hz
Quantity get() const
Get quantity in Hz
Quantity get(const Unit &unit) const
Get the wave characteristics in (recognised) specified units
Get the value in internal units
virtual void putVector(const Vector<Double> &in)
Set the value from internal units (set 0 for empty vector)
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.
Set the internal value if correct values and dimensions
Double makeF(Double v, const Unit &dt, Bool rev=False) const
Get correct data type conversion factor from input Quantum