casacore
|
#include <VelocityMachine.h>
Public Member Functions | |
VelocityMachine (const MFrequency::Ref &freqRef, const Unit &freqUnits, const MVFrequency &restFreq, const MDoppler::Ref &velRef, const Unit &velUnits) | |
Construct a machine from the input values (no frame conversion, implicit frame if necessary) More... | |
VelocityMachine (const MFrequency::Ref &freqRef, const Unit &freqUnits, const MVFrequency &restFreq, const MDoppler::Ref &velRef, const Unit &velUnits, const MeasFrame &frame) | |
Construct a machine from the input values (no frame conversion, explicit frame will be added to freqRef) More... | |
VelocityMachine (const MFrequency::Ref &freqRef, const Unit &freqUnits, const MVFrequency &restFreq, const MFrequency::Types &convertRef, const MDoppler::Ref &velRef, const Unit &velUnits) | |
Construct a machine from the input values (frame conversion, implicit frame assumed if necessary) with explicit velocity reference frame specified. More... | |
VelocityMachine (const MFrequency::Ref &freqref, const Unit &freqUnits, const MVFrequency &restFreq, const MFrequency::Types &convertRef, const MDoppler::Ref &velRef, const Unit &velUnits, const MeasFrame &frame) | |
Construct a machine from the input values (frame conversion, explicit frame) with explicit velocity reference frame specified, and added to freqref. More... | |
VelocityMachine (const VelocityMachine &other) | |
Copy constructor (copy semantics) More... | |
VelocityMachine & | operator= (const VelocityMachine &other) |
Copy assignment (copy semantics) More... | |
~VelocityMachine () | |
const Quantum< Double > & | operator() (const MVFrequency &in) |
Return velocity if frequency given, or a frequency if a velocity is given. More... | |
const Quantum< Double > & | operator() (const MVDoppler &in) |
const Quantum< Double > & | operator() (const Quantum< Double > &in) |
const Quantum< Double > & | makeVelocity (Double in) |
const Quantum< Double > & | makeFrequency (Double in) |
const Quantum< Vector< Double > > & | makeVelocity (const Vector< Double > &in) |
const Quantum< Vector< Double > > & | makeFrequency (const Vector< Double > &in) |
void | set (const MFrequency::Ref &in) |
Set or reset the specified part of the machine. More... | |
void | set (const Unit &in) |
void | set (const MVFrequency &in) |
Sets the rest frequency. More... | |
void | set (const MFrequency::Types &in) |
void | set (const MDoppler::Ref &in) |
void | set (const MeasFrame &in) |
Sets the MeasFrame to be used in conversions. More... | |
const MFrequency::Ref & | getFrequencyReference () const |
Get the general information used in the machine (shadows the sets above and the constructor arguments. More... | |
const Unit & | getFrequencyUnits () const |
const MDoppler::Ref & | getDopplerReference () const |
const Unit & | getDopplerUnits () const |
const MVFrequency & | getRestFrequency () const |
const MFrequency::Types & | getConversionReference () const |
void | reCalculate () |
Recalculate the machinery from the original inputs. More... | |
Private Member Functions | |
VelocityMachine () | |
Construct an empty machine (not implemented) More... | |
void | init () |
Initialise machinery. More... | |
void | copy (const VelocityMachine &other) |
Copy data members. More... | |
Private Attributes | |
MFrequency::Ref | fref_p |
Frequency reference. More... | |
Unit | fun_p |
Frequency units. More... | |
MVFrequency | rest_p |
Rest frequency. More... | |
MFrequency::Types | vfm_p |
Velocity frame. More... | |
MDoppler::Ref | vref_p |
Velocity reference. More... | |
Unit | vun_p |
Velocity units. More... | |
Double | vfac_p |
MFrequency::Convert | cvfv_p |
Frequency conversion forward. More... | |
MFrequency::Convert | cvvf_p |
Frequency conversion backward. More... | |
MDoppler::Convert | cvvo_p |
Velocity conversion forward. More... | |
MDoppler::Convert | cvov_p |
Velocity conversion backward. More... | |
Quantum< Double > | resv_p |
Result. More... | |
Quantum< Double > | resf_p |
Quantum< Vector< Double > > | vresv_p |
Quantum< Vector< Double > > | vresf_p |
Converts between velocities and frequencies
Public interface
From Velocity and machinery
The construction of a VelocityMachine class object creates a machine that can calculate the velocity from a frequency, or vice versa, a frequency from a velocity.
To be able to do the conversions, the machine (or rather its constructors) needs to know the following information:
To be able to convert between different types (say a velocity referenced with respect to the 'LSRK', and a frequency referenced with respect to 'TOPO', the following additional, optional information can be included explicitly in the constructors:
Once the machine has been set up, operator() can be used to convert between velocities and frequencies if the input argument type (e.g. an MVFrequency) can be deduced. In other cases makeFrequency() or makeVelocity() should be used (e.g. if the argument type is a simple Double).
See the test program for more examples
To aid in converting series of frequencies and velocities
Definition at line 183 of file VelocityMachine.h.
casacore::VelocityMachine::VelocityMachine | ( | const MFrequency::Ref & | freqRef, |
const Unit & | freqUnits, | ||
const MVFrequency & | restFreq, | ||
const MDoppler::Ref & | velRef, | ||
const Unit & | velUnits | ||
) |
Construct a machine from the input values (no frame conversion, implicit frame if necessary)
casacore::VelocityMachine::VelocityMachine | ( | const MFrequency::Ref & | freqRef, |
const Unit & | freqUnits, | ||
const MVFrequency & | restFreq, | ||
const MDoppler::Ref & | velRef, | ||
const Unit & | velUnits, | ||
const MeasFrame & | frame | ||
) |
Construct a machine from the input values (no frame conversion, explicit frame will be added to freqRef)
casacore::VelocityMachine::VelocityMachine | ( | const MFrequency::Ref & | freqRef, |
const Unit & | freqUnits, | ||
const MVFrequency & | restFreq, | ||
const MFrequency::Types & | convertRef, | ||
const MDoppler::Ref & | velRef, | ||
const Unit & | velUnits | ||
) |
Construct a machine from the input values (frame conversion, implicit frame assumed if necessary) with explicit velocity reference frame specified.
casacore::VelocityMachine::VelocityMachine | ( | const MFrequency::Ref & | freqref, |
const Unit & | freqUnits, | ||
const MVFrequency & | restFreq, | ||
const MFrequency::Types & | convertRef, | ||
const MDoppler::Ref & | velRef, | ||
const Unit & | velUnits, | ||
const MeasFrame & | frame | ||
) |
Construct a machine from the input values (frame conversion, explicit frame) with explicit velocity reference frame specified, and added to freqref.
casacore::VelocityMachine::VelocityMachine | ( | const VelocityMachine & | other | ) |
Copy constructor (copy semantics)
casacore::VelocityMachine::~VelocityMachine | ( | ) |
|
private |
Construct an empty machine (not implemented)
|
private |
Copy data members.
const MFrequency::Types& casacore::VelocityMachine::getConversionReference | ( | ) | const |
const MDoppler::Ref& casacore::VelocityMachine::getDopplerReference | ( | ) | const |
const Unit& casacore::VelocityMachine::getDopplerUnits | ( | ) | const |
const MFrequency::Ref& casacore::VelocityMachine::getFrequencyReference | ( | ) | const |
Get the general information used in the machine (shadows the sets above and the constructor arguments.
The MeasFrame should be explicitly asked for from the frequency reference by the user
const Unit& casacore::VelocityMachine::getFrequencyUnits | ( | ) | const |
const MVFrequency& casacore::VelocityMachine::getRestFrequency | ( | ) | const |
|
private |
Initialise machinery.
const Quantum<Vector<Double> >& casacore::VelocityMachine::makeFrequency | ( | const Vector< Double > & | in | ) |
const Quantum<Vector<Double> >& casacore::VelocityMachine::makeVelocity | ( | const Vector< Double > & | in | ) |
const Quantum<Double>& casacore::VelocityMachine::operator() | ( | const MVFrequency & | in | ) |
Return velocity if frequency given, or a frequency if a velocity is given.
VelocityMachine& casacore::VelocityMachine::operator= | ( | const VelocityMachine & | other | ) |
Copy assignment (copy semantics)
void casacore::VelocityMachine::reCalculate | ( | ) |
Recalculate the machinery from the original inputs.
Note that in all normal circumstances this function does not have to be used (the set() methods will do it automatically). At the moment I cannot think of any circumstance it should be used explicitly.
void casacore::VelocityMachine::set | ( | const MDoppler::Ref & | in | ) |
void casacore::VelocityMachine::set | ( | const MeasFrame & | in | ) |
Sets the MeasFrame to be used in conversions.
void casacore::VelocityMachine::set | ( | const MFrequency::Ref & | in | ) |
Set or reset the specified part of the machine.
The machinery will be reset to reflect the changes made.
Sets a new frequency reference. Note that if an explicit frame has been used in earlier constructors, the frame should again be set explicitly with set(MeasFrame).
void casacore::VelocityMachine::set | ( | const MFrequency::Types & | in | ) |
void casacore::VelocityMachine::set | ( | const MVFrequency & | in | ) |
Sets the rest frequency.
void casacore::VelocityMachine::set | ( | const Unit & | in | ) |
|
private |
Frequency conversion forward.
Definition at line 296 of file VelocityMachine.h.
|
private |
Velocity conversion backward.
Definition at line 302 of file VelocityMachine.h.
|
private |
Frequency conversion backward.
Definition at line 298 of file VelocityMachine.h.
|
private |
Velocity conversion forward.
Definition at line 300 of file VelocityMachine.h.
|
private |
Frequency reference.
Definition at line 279 of file VelocityMachine.h.
|
private |
Frequency units.
Definition at line 282 of file VelocityMachine.h.
Definition at line 306 of file VelocityMachine.h.
|
private |
Rest frequency.
Definition at line 285 of file VelocityMachine.h.
Result.
Definition at line 305 of file VelocityMachine.h.
|
private |
Definition at line 293 of file VelocityMachine.h.
|
private |
Velocity frame.
Definition at line 287 of file VelocityMachine.h.
|
private |
Velocity reference.
Definition at line 289 of file VelocityMachine.h.
Definition at line 308 of file VelocityMachine.h.
Definition at line 307 of file VelocityMachine.h.
|
private |
Velocity units.
Definition at line 292 of file VelocityMachine.h.