|
| 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. More...
|
|
| MeasConvert (const MeasConvert< M > &other) |
| Copy constructor. More...
|
|
MeasConvert< M > & | operator= (const MeasConvert< M > &other) |
| Copy assignment. More...
|
|
| MeasConvert (const M &ep) |
| Construct a conversion for the specified Measure and reference. More...
|
|
| 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. More...
|
|
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. More...
|
|
void | setOut (const typename M::Ref &mr) |
| Set a new output reference. More...
|
|
void | setOut (typename M::Types mr) |
|
void | set (const M &val, const typename M::Ref &mr) |
| Set a new model and reference. More...
|
|
void | set (const M &val, typename M::Types mr) |
|
virtual void | set (const MeasValue &val) |
| Set a new model value only. More...
|
|
virtual void | set (const Unit &inunit) |
| Set a new model unit only. More...
|
|
virtual void | addMethod (uInt method) |
| Add a method (Note: uInt should be an enum from the appropiate Measure) More...
|
|
virtual void | addFrameType (uInt tp) |
| Add the frame type (Note: tp should be an MeasFrame::FrameType) More...
|
|
virtual Int | nMethod () const |
| Get number of methods. More...
|
|
virtual uInt | getMethod (uInt which) const |
| Get method. More...
|
|
Bool | isNOP () |
| Is the conversion engine empty? More...
|
|
virtual void | print (ostream &os) const |
| Print conversion engine. More...
|
|
virtual | ~MConvertBase () |
|
template<class M>
class casacore::MeasConvert< M >
Conversion of Measures.
Intended use:
Public interface
Review Status
- Reviewed By:
- UNKNOWN
- Date Reviewed:
- before2004/08/25
- Test programs:
- tMeasure
Prerequisite
Etymology
Synopsis
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:
-
MEpoch::Convert(MEpoch, MEpoch::Ref), where the MEpoch is a template for subsequent conversions, i.e. it will remember the value (with its reference) and the MeasRef output reference.
-
MEpoch::Convert(MEpoch) with a subsequent setOut(MEpoch::Ref)
-
MEpoch::Convert(MEpoch::Ref in, MEpoch::Ref out) is a template for conversions from the input reference to the output reference. The 'template' model used is the default value for the Measure, with no units.
-
MEpoch::Convert(Unit, MEpoch::Ref in, MEpoch::Ref out) is a template for conversions from the input reference to the output reference. The 'template' model used is the default value for the Measure, with the default units as specified.
-
MEpoch::Convert() with a setModel(MEpoch) and setOut().
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):
-
(MEpoch, MEpoch::Ref): will create a new conversion method, and use it to produce the result of converting the MEpoch to the specified frame
-
(MEpoch): will create a new conversion method from the MEpoch to the MeasRef belonging to the MeasConvert
-
(Quantity): will use the conversion chain deduced from the MEpoch model in the definition of MeasConvert, and will convert the Quantity
-
(Quantum<Vector<Double> >) as previous
-
(Double): will use the units (if present) as specified in the MeasConvert object to construct the internal value to be converted
-
(Vector<Double> >): as previous
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).
Example
See Measure for an example
Motivation
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 44 of file MBaseline.h.