casa
$Rev:20696$
|
A Measure: Doppler shift. More...
#include <MDoppler.h>
Public Types | |
enum | Types { RADIO, Z, RATIO, BETA, GAMMA, N_Types, OPTICAL, RELATIVISTIC, DEFAULT } |
Types of known MDopplers Warning: The order defines the order in the translation matrix FromTo in the getConvert routine; Do not change the order without changing the array; Additions should be made before N_types, and an additional row and column should be coded in FromTo, and in showType(); More... | |
typedef MVDoppler | MVType |
Measure value container for this class (i.e. | |
typedef MCDoppler | MCType |
Measure conversion routines for this class (i.e. | |
typedef MeasRef< MDoppler > | Ref |
Measure reference (i.e. | |
typedef MeasConvert< MDoppler > | Convert |
Measure Convert (i.e. | |
typedef ScalarMeasColumn < MDoppler > | ScalarColumn |
Measure table Columns (e.g., MDoppler::ScalarColumn) | |
typedef ArrayMeasColumn< MDoppler > | ArrayColumn |
Public Member Functions | |
typedef | WHATEVER_SUN_TYPEDEF (MDoppler) Types Types |
Reference enum Types (included originally for gcc 2.95) | |
MDoppler () | |
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; Default constructor; generates a zero rest Doppler | |
MDoppler (const MVDoppler &dt) | |
Create from data and reference. | |
MDoppler (const MVDoppler &dt, const MDoppler::Ref &rf) | |
MDoppler (const MVDoppler &dt, MDoppler::Types rf) | |
MDoppler (const Quantity &dt) | |
MDoppler (const Quantity &dt, const MDoppler::Ref &rf) | |
MDoppler (const Quantity &dt, MDoppler::Types rf) | |
MDoppler (const Measure *dt) | |
MDoppler (const MeasValue *dt) | |
virtual | ~MDoppler () |
virtual const String & | tellMe () const |
Tell me your type. | |
virtual uInt | type () const |
Get the type (== Register() of derived Measure (faster than Strings) All should have: static uInt myType();. | |
Bool | giveMe (MDoppler::Ref &mr, const String &in) |
virtual Bool | setOffset (const Measure &in) |
Set the offset in the reference (False if non-matching Measure) | |
virtual Bool | setRefString (const String &in) |
Set the reference type to the specified String. | |
virtual const String & | getDefaultType () const |
Get the default reference type. | |
virtual const String * | allTypes (Int &nall, Int &nextra, const uInt *&typ) const |
Get a list of all known reference codes. | |
virtual void | checkTypes () const |
Check if all internal tables of types (both enum and String) are complete and correct. | |
virtual String | getRefString () const |
Get the reference type (for records, including codes like R_) | |
Quantity | get (const Unit &un) const |
Get in specified units. | |
Vector< Double > | shiftFrequency (const Vector< Double > &freq) const |
Shift the input frequencies to the output frequencies. | |
Quantum< Vector< Double > > | shiftFrequency (const Quantum< Vector< Double > > &freq) const |
virtual Measure * | clone () const |
Make a copy. | |
Static Public Member Functions | |
static const String & | showMe () |
static void | assure (const Measure &in) |
static MDoppler::Types | castType (uInt tp) |
Translate reference code. | |
static const String & | showType (MDoppler::Types tp) |
static const String & | showType (uInt tp) |
static Bool | getType (MDoppler::Types &tp, const String &in) |
Translate string to reference code. | |
static const String * | allMyTypes (Int &nall, Int &nextra, const uInt *&typ) |
static void | checkMyTypes () |
static uInt | myType () |
Get my type (as Register) | |
Friends | |
class | MeasConvert< MDoppler > |
Conversion of data. |
A Measure: Doppler shift.
Public interface
From Measure and Doppler
MDoppler forms the derived Measure class for Doppler shifts.
An MDoppler can be generated from a simple value (or an MVDoppler ), which is then interpreted as a Doppler ratio, and a reference, with a RADIO type as default.
It can also be generated from a Quantity, where the interpretation depends on the dimensionality of the Quantity:
The different types of Doppler (with F = f/f0, the frequency ratio), are:
Note that the ones with an '*' have no real interpretation (although the calculation will proceed) if given as a velocity.
Conversion between the different types is done with the standard MeasConvert class (MDoppler::Convert
in this case).
Dopplers can be created from an MFrequency object, or from an MRadialVelocity object.
A shiftFrequency() method can shift frequencies.
Dopplers do not need a reference frame.
Conversion of a radio Doppler to an optical
MDoppler radio(0.01); // A radio Doppler value cout << "Doppler radio = " << radio << "; optical = " << MDoppler::Convert(radio, MDoppler::OPTICAL)() << // Convert endl;
Setting up a conversion
MDoppler::Convert to_opt(MDoppler::RADIO, MDoppler::OPTICAL); for (Double d=0; d<0.1; d += 0.005) { cout << "radio = " << d << " to optical = " << to_opt(d) << endl;
Definition at line 134 of file MDoppler.h.
Definition at line 171 of file MDoppler.h.
typedef MeasConvert<MDoppler> casa::MDoppler::Convert |
typedef MCDoppler casa::MDoppler::MCType |
Measure conversion routines for this class (i.e.
Definition at line 164 of file MDoppler.h.
typedef MVDoppler casa::MDoppler::MVType |
Measure value container for this class (i.e.
Definition at line 162 of file MDoppler.h.
typedef MeasRef<MDoppler> casa::MDoppler::Ref |
Measure table Columns (e.g., MDoppler::ScalarColumn)
Definition at line 170 of file MDoppler.h.
Types of known MDopplers
Warning: The order defines the order in the translation matrix FromTo in the getConvert routine; Do not change the order without changing the array; Additions should be made before N_types, and an additional row and column should be coded in FromTo, and in showType();
Reimplemented from casa::Measure.
Definition at line 149 of file MDoppler.h.
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;
Default constructor; generates a zero rest Doppler
casa::MDoppler::MDoppler | ( | const MVDoppler & | dt | ) |
Create from data and reference.
casa::MDoppler::MDoppler | ( | const MVDoppler & | dt, |
const MDoppler::Ref & | rf | ||
) |
casa::MDoppler::MDoppler | ( | const MVDoppler & | dt, |
MDoppler::Types | rf | ||
) |
casa::MDoppler::MDoppler | ( | const Quantity & | dt | ) |
casa::MDoppler::MDoppler | ( | const Quantity & | dt, |
const MDoppler::Ref & | rf | ||
) |
casa::MDoppler::MDoppler | ( | const Quantity & | dt, |
MDoppler::Types | rf | ||
) |
casa::MDoppler::MDoppler | ( | const Measure * | dt | ) |
casa::MDoppler::MDoppler | ( | const MeasValue * | dt | ) |
virtual casa::MDoppler::~MDoppler | ( | ) | [virtual] |
static const String* casa::MDoppler::allMyTypes | ( | Int & | nall, |
Int & | nextra, | ||
const uInt *& | typ | ||
) | [static] |
virtual const String* casa::MDoppler::allTypes | ( | Int & | nall, |
Int & | nextra, | ||
const uInt *& | typ | ||
) | const [virtual] |
Get a list of all known reference codes.
nall returns the number in list, nextra the number of specials (like planets) that should be at end of list). typ returns the list of corresponding types.
Reimplemented from casa::Measure.
static void casa::MDoppler::assure | ( | const Measure & | in | ) | [static] |
static MDoppler::Types casa::MDoppler::castType | ( | uInt | tp | ) | [static] |
Translate reference code.
The uInt version has a check for valid codes (i.e. it is a safe cast).
static void casa::MDoppler::checkMyTypes | ( | ) | [static] |
virtual void casa::MDoppler::checkTypes | ( | ) | const [virtual] |
Check if all internal tables of types (both enum and String) are complete and correct.
This function is called automatically if and when necessary.
Implements casa::Measure.
virtual Measure* casa::MDoppler::clone | ( | ) | const [virtual] |
Make a copy.
Implements casa::Measure.
Quantity casa::MDoppler::get | ( | const Unit & | un | ) | const |
Get in specified units.
virtual const String& casa::MDoppler::getDefaultType | ( | ) | const [virtual] |
Get the default reference type.
Implements casa::Measure.
virtual String casa::MDoppler::getRefString | ( | ) | const [virtual] |
Get the reference type (for records, including codes like R_)
Implements casa::Measure.
static Bool casa::MDoppler::getType | ( | MDoppler::Types & | tp, |
const String & | in | ||
) | [static] |
Translate string to reference code.
Referenced by casa::PlotMSTransformations::setVelDef().
Bool casa::MDoppler::giveMe | ( | MDoppler::Ref & | mr, |
const String & | in | ||
) |
static uInt casa::MDoppler::myType | ( | ) | [static] |
Get my type (as Register)
virtual Bool casa::MDoppler::setOffset | ( | const Measure & | in | ) | [virtual] |
Set the offset in the reference (False if non-matching Measure)
Implements casa::Measure.
virtual Bool casa::MDoppler::setRefString | ( | const String & | in | ) | [virtual] |
Set the reference type to the specified String.
False if illegal string, reference set to DEFAULT.
Implements casa::Measure.
Vector<Double> casa::MDoppler::shiftFrequency | ( | const 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.
Quantum<Vector<Double> > casa::MDoppler::shiftFrequency | ( | const Quantum< Vector< Double > > & | freq | ) | const |
static const String& casa::MDoppler::showMe | ( | ) | [static] |
static const String& casa::MDoppler::showType | ( | MDoppler::Types | tp | ) | [static] |
Referenced by casa::PlotMSTransformations::veldefStr().
static const String& casa::MDoppler::showType | ( | uInt | tp | ) | [static] |
virtual const String& casa::MDoppler::tellMe | ( | ) | const [virtual] |
Tell me your type.
Implements casa::Measure.
virtual uInt casa::MDoppler::type | ( | ) | const [virtual] |
Get the type (== Register() of derived Measure (faster than Strings) All should have: static uInt myType();.
Implements casa::Measure.
typedef casa::MDoppler::WHATEVER_SUN_TYPEDEF | ( | MDoppler | ) |
Reference enum Types (included originally for gcc 2.95)
friend class MeasConvert< MDoppler > [friend] |
Conversion of data.
Definition at line 139 of file MDoppler.h.