MRadialVelocity.h

Classes

MRadialVelocity -- A Measure: radial velocity (full description)

class MRadialVelocity : public MeasBase<MVRadialVelocity, MeasRef<MRadialVelocity> >

Types

enum Types

LSRK
LSRD
BARY
GEO
TOPO
GALACTO
LGROUP
CMB
N_Types
DEFAULT = LSRK,
Defaults

Interface

Public Members
typedef WHATEVER_SUN_TYPEDEF(MRadialVelocity) Types Types
MRadialVelocity()
MRadialVelocity(const MVRadialVelocity &dt)
MRadialVelocity(const MVRadialVelocity &dt, const MRadialVelocity::Ref &rf)
MRadialVelocity(const MVRadialVelocity &dt, MRadialVelocity::Types rf)
MRadialVelocity(const Quantity &dt)
MRadialVelocity(const Quantity &dt, const MRadialVelocity::Ref &rf)
MRadialVelocity(const Quantity &dt, MRadialVelocity::Types rf)
MRadialVelocity(const Measure *dt)
MRadialVelocity(const MeasValue *dt)
virtual ~MRadialVelocity()
virtual const String &tellMe() const
static const String &showMe()
virtual uInt type() const
static void assure(const Measure &in)
static MRadialVelocity::Types castType(uInt tp)
static const String &showType(MRadialVelocity::Types tp)
static const String &showType(uInt tp)
static Bool getType(MRadialVelocity::Types &tp, const String &in)
Bool giveMe(MRadialVelocity::Ref &mr, const String &in)
virtual Bool setOffset(const Measure &in)
virtual Bool setRefString(const String &in)
virtual const String &getDefaultType() const
virtual const String *const allTypes(Int &nall, Int &nextra, const uInt *&typ) const
static const String *const allMyTypes(Int &nall, Int &nextra, const uInt *&typ)
virtual void checkTypes() const
static void checkMyTypes()
virtual String getRefString() const
static uInt myType()
Quantity get(const Unit &un) const
MDoppler toDoppler()
static MDoppler toDoppler(const Measure &in)
static MRadialVelocity fromDoppler(const MDoppler &dop)
static MRadialVelocity fromDoppler(const MDoppler &dop, MRadialVelocity::Types typ)
static MRadialVelocity fromDoppler(const Measure &dop, MRadialVelocity::Types typ)
virtual Measure *clone() const

Description

Review Status

Reviewed By:
UNKNOWN
Date Reviewed:
before2004/08/25
Programs:
Tests:

Prerequisite

Etymology

Synopsis

MRadialVelocity is a derived Measure class for radial velocity.
An MRadialVelocity can be generated from a simple value (or an MVRadialVelocity object), which is then interpreted as a RadialVelocity in m/s, and a reference, with an LSRK type as default.
It can also be generated from a Quantity, where the interpretation depends on the dimensionality of the Quantity: The different reference types of a RadialVelocity are:

Conversion between the different types is done with the standard MeasConvert class (MRadialVelocity::Convert in this case).
Some of the conversions are only possible if frame information has been filled in. The following frame information is necessary if a conversion goes to or from the (different) specified types:


Caution For large radial velocities (of order c) the conversions are not precise, and not completely reversable, due to unknown transverse velocities, and the additive way in which corrections are done. They are correct to first order wrt relativistic effects
An MRadialVelocity can be created from an MDoppler by the fromDoppler() member. It can be converted to an MDoppler with the toDoppler(). Comparable methods are available for MFrequency as toRadial() and fromRadial.

Example

Get the Doppler shift for an oberved HI RadialVelocity of 100 km/s
	cout << "Redshift for 100 km/s: " <<
		MDoppler::Convert( MRadialVelocity( Quantity(100., "km/s"),
				      MRadialVelocity::TOPO).toDoppler(),
				   MDoppler::Z)() << endl;

Motivation

To Do

Member Description

enum Types

Types of known MRadialVelocity

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().

typedef WHATEVER_SUN_TYPEDEF(MRadialVelocity) Types Types

Reference enum Types (included originally for gcc 2.95)

MRadialVelocity()

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 RadialVelocity

MRadialVelocity(const MVRadialVelocity &dt)
MRadialVelocity(const MVRadialVelocity &dt, const MRadialVelocity::Ref &rf)
MRadialVelocity(const MVRadialVelocity &dt, MRadialVelocity::Types rf)
MRadialVelocity(const Quantity &dt)
MRadialVelocity(const Quantity &dt, const MRadialVelocity::Ref &rf)
MRadialVelocity(const Quantity &dt, MRadialVelocity::Types rf)
MRadialVelocity(const Measure *dt)
MRadialVelocity(const MeasValue *dt)

Create from data and reference

virtual ~MRadialVelocity()

virtual const String &tellMe() const
static const String &showMe()
virtual uInt type() const
static void assure(const Measure &in)

Tell me your type

static MRadialVelocity::Types castType(uInt tp)
static const String &showType(MRadialVelocity::Types tp)
static const String &showType(uInt tp)

Translate reference code. The uInt version has a check for valid codes (i.e. it is a safe cast).

Thrown Exceptions

static Bool getType(MRadialVelocity::Types &tp, const String &in)
Bool giveMe(MRadialVelocity::Ref &mr, const String &in)

Translate string to reference code

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. False if illegal string, reference set to DEFAULT.

virtual const String &getDefaultType() const

Get the default reference type

virtual const String *const allTypes(Int &nall, Int &nextra, const uInt *&typ) const
static const String *const allMyTypes(Int &nall, Int &nextra, const uInt *&typ)

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.

virtual void checkTypes() const
static void checkMyTypes()

Check if all internal tables of types (both enum and String) are complete and correct. This function is called automatically if and when necessary.

Thrown Exceptions

virtual String getRefString() const

Get the reference type (for records, including codes like R_)

static uInt myType()

Get my type (as Register)

Quantity get(const Unit &un) const

Get radial velocity in specified units

static MDoppler toDoppler(const Measure &in)

Make a Doppler velocity (as an MDoppler::BETA default) from the RadialVelocity.

Local use only

MDoppler toDoppler()

Make a Doppler velocity (as an MDoppler::BETA default) from the RadialVelocity.

static MRadialVelocity fromDoppler(const Measure &dop, MRadialVelocity::Types typ)

Make a RadialVelocity from the Doppler velocity (assuming LSRK default)

For internal use only

static MRadialVelocity fromDoppler(const MDoppler &dop)
static MRadialVelocity fromDoppler(const MDoppler &dop, MRadialVelocity::Types typ)

Make a RadialVelocity from the Doppler velocity (assuming LSRK default)

virtual Measure *clone() const

Make a copy