MRadialVelocity.h
Classes
- MRadialVelocity -- A Measure: radial velocity (full description)
class MRadialVelocity : public MeasBase<MVRadialVelocity, MeasRef<MRadialVelocity> >
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
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:
- MRadialVelocity::LSRD --- Local Standard of Rest (J2000) -- as the
dynamical definition (IAU, [9,12,7] km/s in galactic coordinates)
- MRadialVelocity::LSRK -- LSR as a kinematical (radio) definition --
20.0 km/s in direction ra,dec = [270,+30] deg (B1900.0)
- MRadialVelocity::BARY -- Barycentric (J2000)
- MRadialVelocity::GEO --- Geocentric
- MRadialVelocity::TOPO -- Topocentric
- MRadialVelocity::GALACTO -- Galacto centric (with rotation of 220 km/s
in direction l,b = [90,0] deg.
- MRadialVelocity::LGROUP -- Local group velocity -- 308km/s towards
l,b = [105,-7] deg (F. Ghigo)
- MRadialVelocity::CMB -- CMB velocity -- 369.5km/s towards
l,b = [264.4, 48.4] deg (F. Ghigo)
- MRadialVelocity::DEFAULT = LSRK
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:
- Epoch: TOPO, GEO
- Position: TOPO
- Direction all
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
Types of known MRadialVelocity
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().
Reference enum Types (included originally for gcc 2.95)
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
Create from data and reference
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
- AipsError in the uInt interface if illegal code given
static Bool getType(MRadialVelocity::Types &tp, const String &in)
Bool giveMe(MRadialVelocity::Ref &mr, const String &in)
Translate string to reference code
Set the offset in the reference (False if non-matching Measure)
Set the reference type to the specified String. False if illegal
string, reference set to DEFAULT.
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.
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
- AipsError if a (programming) error in the types.
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
Make a Doppler velocity (as an MDoppler::BETA default) from the RadialVelocity.
Local use only
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)
Make a copy