casa
$Rev:20696$
|
Conversion of Measures. More...
#include <MeasConvert.h>
Public Member Functions | |
MeasConvert () | |
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;Construct an empty MeasConvert. | |
MeasConvert (const MeasConvert< M > &other) | |
Copy constructor. | |
MeasConvert< M > & | operator= (const MeasConvert< M > &other) |
Copy assignment. | |
MeasConvert (const M &ep) | |
Construct a conversion for the specified Measure and reference. | |
MeasConvert (const M &ep, const typename M::Ref &mr) | |
MeasConvert (const Measure &ep, const typename M::Ref &mr) | |
MeasConvert (const M &ep, typename M::Types mr) | |
MeasConvert (const Measure &ep, typename M::Types mr) | |
MeasConvert (const typename M::Ref &mrin, const typename M::Ref &mr) | |
MeasConvert (const typename M::Ref &mrin, typename M::Types mr) | |
MeasConvert (typename M::Types mrin, const typename M::Ref &mr) | |
MeasConvert (typename M::Types mrin, typename M::Types mr) | |
MeasConvert (const Unit &inunit, const typename M::Ref &mrin, const typename M::Ref &mr) | |
MeasConvert (const Unit &inunit, const typename M::Ref &mrin, typename M::Types mr) | |
MeasConvert (const Unit &inunit, typename M::Types mrin, const typename M::Ref &mr) | |
MeasConvert (const Unit &inunit, typename M::Types mrin, typename M::Types mr) | |
~MeasConvert () | |
const M & | operator() () |
The actual conversion operations. | |
const M & | operator() (Double val) |
const M & | operator() (const Vector< Double > &val) |
const M & | operator() (const Quantum< Double > &val) |
const M & | operator() (const Quantum< Vector< Double > > &val) |
const M & | operator() (const typename M::MVType &val) |
const M & | operator() (const MeasVal *val) |
const M & | operator() (const M &val) |
const M & | operator() (const M &val, const typename M::Ref &mr) |
const M & | operator() (const M &val, typename M::Types mr) |
const M & | operator() (const typename M::Ref &mr) |
const M & | operator() (typename M::Types mr) |
virtual void | setModel (const Measure &val) |
Set a new model for the conversion. | |
void | setOut (const typename M::Ref &mr) |
Set a new output reference. | |
void | setOut (typename M::Types mr) |
void | set (const M &val, const typename M::Ref &mr) |
Set a new model and reference. | |
void | set (const M &val, typename M::Types mr) |
virtual void | set (const MeasValue &val) |
Set a new model value only. | |
virtual void | set (const Unit &inunit) |
Set a new model unit only. | |
virtual void | addMethod (uInt method) |
Add a method (Note: uInt should be an enum from the appropiate Measure) | |
virtual void | addFrameType (uInt tp) |
Add the frame type (Note: tp should be an MeasFrame::FrameType) | |
virtual Int | nMethod () const |
Get number of methods. | |
virtual uInt | getMethod (uInt which) const |
Get method. | |
Bool | isNOP () |
Is the conversion engine empty? | |
virtual void | print (ostream &os) const |
Print conversion engine. | |
Private Member Functions | |
void | init () |
Initialise pointers. | |
void | copy (const MeasConvert< M > &other) |
Copy a MeasConvert. | |
void | clear () |
Clear self. | |
void | create () |
Create the conversion routine chain. | |
const M::MVType & | convert () |
Convert a value. | |
const M::MVType & | convert (const typename M::MVType &val) |
Private Attributes | |
Measure * | model |
The model template Measure. | |
Unit | unit |
The model unit to be used in conversions. | |
M::Ref | outref |
The output reference. | |
M::MVType * | offin |
The input offset. | |
M::MVType * | offout |
The output offset. | |
Block< uInt > | crout |
Vector of conversion routines (length variable) | |
uInt | crtype |
Coded (with MeasFrame::FrameTypes) frames used in conversion. | |
MCBase * | cvdat |
Local conversion data. | |
Int | lres |
Cyclic buffer for return values. | |
M * | result [4] |
M::MVType * | locres |
Local variables that can be used in conversion. |
Conversion of Measures.
Public interface
<h3>Review Status</h3><dl><dt>Reviewed By:<dd>UNKNOWN<dt>Date Reviewed:<dd>before2004/08/25<dt>Test programs:<dd>tMeasure</dl>
MeasConvert can convert a Measure to the same type of Measure in a different reference frame. The MeasConvert is a templated class, but has typedefs, which are strongly recommended to be used, for the allowed conversions, like MEpoch::Convert.
The basic operation is to create a MeasConvert with either of:
An empty MeasRef argument indicates no conversion will be attempted
. The constructor, and set functions, analyse the 'template' Measure and the output reference frame, and construct a pointer (in practice a list of pointers to bypass the necessity of creating too many conversion functions) to a conversion routine.
An isNOP()
function is available to test if the created conversion engine is empty.
Actual conversions are done with the () operator, which produces a new MEpoch (or other appropiate Measure).
Possible arguments are (MVEpoch is used here generic, and indicates the internal format of a Measure; possibly, to make sure distinction between values with and without units possible, even simple Measures will have their own internal class format, e.g. MVDouble. The possible arguments to the () conversion operator are (again Epoch is used for the generic Measure):
Float versions will be produced if necessary.
The conversion analyser expects that all Measure classes have a set of routines to do the actual analysing and conversion. (see MCBase class for how this is done in practice).
If the standard conversion is not sufficient, additional methods can be added at the end of the list with the addMethod()
member function (for real pros).
See Measure for an example
Conversion of Measures will in general be done on a series of values. Separating the analysis of the calculations necessary for the conversion from the actual conversion could speed up the process.
Definition at line 145 of file MeasConvert.h.
casa::MeasConvert< M >::MeasConvert | ( | ) |
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;
Construct an empty MeasConvert.
It is not usable, unless a setModel, and probably a setOut has been done.
casa::MeasConvert< M >::MeasConvert | ( | const MeasConvert< M > & | other | ) |
Copy constructor.
casa::MeasConvert< M >::MeasConvert | ( | const M & | ep | ) |
Construct a conversion for the specified Measure and reference.
casa::MeasConvert< M >::MeasConvert | ( | const M & | ep, |
const typename M::Ref & | mr | ||
) |
casa::MeasConvert< M >::MeasConvert | ( | const Measure & | ep, |
const typename M::Ref & | mr | ||
) |
casa::MeasConvert< M >::MeasConvert | ( | const M & | ep, |
typename M::Types | mr | ||
) |
casa::MeasConvert< M >::MeasConvert | ( | const Measure & | ep, |
typename M::Types | mr | ||
) |
casa::MeasConvert< M >::MeasConvert | ( | const typename M::Ref & | mrin, |
const typename M::Ref & | mr | ||
) |
casa::MeasConvert< M >::MeasConvert | ( | const typename M::Ref & | mrin, |
typename M::Types | mr | ||
) |
casa::MeasConvert< M >::MeasConvert | ( | typename M::Types | mrin, |
const typename M::Ref & | mr | ||
) |
casa::MeasConvert< M >::MeasConvert | ( | typename M::Types | mrin, |
typename M::Types | mr | ||
) |
casa::MeasConvert< M >::MeasConvert | ( | const Unit & | inunit, |
const typename M::Ref & | mrin, | ||
const typename M::Ref & | mr | ||
) |
casa::MeasConvert< M >::MeasConvert | ( | const Unit & | inunit, |
const typename M::Ref & | mrin, | ||
typename M::Types | mr | ||
) |
casa::MeasConvert< M >::MeasConvert | ( | const Unit & | inunit, |
typename M::Types | mrin, | ||
const typename M::Ref & | mr | ||
) |
casa::MeasConvert< M >::MeasConvert | ( | const Unit & | inunit, |
typename M::Types | mrin, | ||
typename M::Types | mr | ||
) |
casa::MeasConvert< M >::~MeasConvert | ( | ) |
virtual void casa::MeasConvert< M >::addFrameType | ( | uInt | tp | ) | [virtual] |
Add the frame type (Note: tp should be an MeasFrame::FrameType)
Implements casa::MConvertBase.
virtual void casa::MeasConvert< M >::addMethod | ( | uInt | method | ) | [virtual] |
Add a method (Note: uInt should be an enum from the appropiate Measure)
Implements casa::MConvertBase.
void casa::MeasConvert< M >::clear | ( | ) | [private] |
Clear self.
const M::MVType& casa::MeasConvert< M >::convert | ( | ) | [private] |
Convert a value.
const M::MVType& casa::MeasConvert< M >::convert | ( | const typename M::MVType & | val | ) | [private] |
void casa::MeasConvert< M >::copy | ( | const MeasConvert< M > & | other | ) | [private] |
Copy a MeasConvert.
void casa::MeasConvert< M >::create | ( | ) | [private] |
Create the conversion routine chain.
virtual uInt casa::MeasConvert< M >::getMethod | ( | uInt | which | ) | const [virtual] |
Get method.
Implements casa::MConvertBase.
void casa::MeasConvert< M >::init | ( | ) | [private] |
Initialise pointers.
Bool casa::MeasConvert< M >::isNOP | ( | ) | [inline] |
Is the conversion engine empty?
Definition at line 232 of file MeasConvert.h.
virtual Int casa::MeasConvert< M >::nMethod | ( | ) | const [virtual] |
Get number of methods.
Implements casa::MConvertBase.
const M& casa::MeasConvert< M >::operator() | ( | ) |
The actual conversion operations.
Convert model Measure to output frame
const M& casa::MeasConvert< M >::operator() | ( | Double | val | ) |
const M& casa::MeasConvert< M >::operator() | ( | const Vector< Double > & | val | ) |
const M& casa::MeasConvert< M >::operator() | ( | const Quantum< Double > & | val | ) |
const M& casa::MeasConvert< M >::operator() | ( | const Quantum< Vector< Double > > & | val | ) |
const M& casa::MeasConvert< M >::operator() | ( | const typename M::MVType & | val | ) |
const M& casa::MeasConvert< M >::operator() | ( | const MeasVal * | val | ) |
const M& casa::MeasConvert< M >::operator() | ( | const M & | val | ) |
const M& casa::MeasConvert< M >::operator() | ( | const M & | val, |
const typename M::Ref & | mr | ||
) |
const M& casa::MeasConvert< M >::operator() | ( | const M & | val, |
typename M::Types | mr | ||
) |
const M& casa::MeasConvert< M >::operator() | ( | const typename M::Ref & | mr | ) |
const M& casa::MeasConvert< M >::operator() | ( | typename M::Types | mr | ) |
MeasConvert<M>& casa::MeasConvert< M >::operator= | ( | const MeasConvert< M > & | other | ) |
Copy assignment.
virtual void casa::MeasConvert< M >::print | ( | ostream & | os | ) | const [virtual] |
Print conversion engine.
Implements casa::MConvertBase.
void casa::MeasConvert< M >::set | ( | const M & | val, |
const typename M::Ref & | mr | ||
) |
Set a new model and reference.
void casa::MeasConvert< M >::set | ( | const M & | val, |
typename M::Types | mr | ||
) |
virtual void casa::MeasConvert< M >::set | ( | const MeasValue & | val | ) | [virtual] |
Set a new model value only.
Implements casa::MConvertBase.
virtual void casa::MeasConvert< M >::set | ( | const Unit & | inunit | ) | [virtual] |
Set a new model unit only.
Implements casa::MConvertBase.
virtual void casa::MeasConvert< M >::setModel | ( | const Measure & | val | ) | [virtual] |
Set a new model for the conversion.
Implements casa::MConvertBase.
void casa::MeasConvert< M >::setOut | ( | const typename M::Ref & | mr | ) |
Set a new output reference.
void casa::MeasConvert< M >::setOut | ( | typename M::Types | mr | ) |
Block<uInt> casa::MeasConvert< M >::crout [private] |
Vector of conversion routines (length variable)
Definition at line 249 of file MeasConvert.h.
Referenced by casa::MeasConvert< MEpoch >::isNOP().
uInt casa::MeasConvert< M >::crtype [private] |
Coded (with MeasFrame::FrameTypes) frames used in conversion.
Definition at line 251 of file MeasConvert.h.
MCBase* casa::MeasConvert< M >::cvdat [private] |
Local conversion data.
Definition at line 253 of file MeasConvert.h.
M::MVType* casa::MeasConvert< M >::locres [private] |
Local variables that can be used in conversion.
Definition at line 262 of file MeasConvert.h.
Int casa::MeasConvert< M >::lres [private] |
Measure* casa::MeasConvert< M >::model [private] |
The model template Measure.
Definition at line 239 of file MeasConvert.h.
M::MVType* casa::MeasConvert< M >::offin [private] |
The input offset.
Definition at line 245 of file MeasConvert.h.
M::MVType* casa::MeasConvert< M >::offout [private] |
The output offset.
Definition at line 247 of file MeasConvert.h.
M::Ref casa::MeasConvert< M >::outref [private] |
The output reference.
Definition at line 243 of file MeasConvert.h.
M* casa::MeasConvert< M >::result[4] [private] |
Definition at line 258 of file MeasConvert.h.
Unit casa::MeasConvert< M >::unit [private] |
The model unit to be used in conversions.
Definition at line 241 of file MeasConvert.h.