Loading...
Searching...
No Matches
casacore::MRadialVelocity Class Reference
measures package (libcasa_measures) » Measures_module

More...

`#include <MRadialVelocity.h>`

## Public Types

enum | Types { LSRK , LSRD , BARY , GEO , TOPO , GALACTO , LGROUP , CMB , N_Types , DEFAULT , LSR }
| 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(); . More...
typedef MVRadialVelocity | MVType
| Measure value container for this class (i.e.
typedef MCRadialVelocity | MCType
| Measure conversion routines for this class (i.e.
typedef MeasRef< MRadialVelocity > | Ref
| Measure reference (i.e.
typedef MeasConvert< MRadialVelocity > | Convert
| Measure conversion use (i.e.
typedef ScalarMeasColumn< MRadialVelocity > | ScalarColumn
| Measure table Columns (e.g., MRadialVelocity::ScalarColumn).
typedef ArrayMeasColumn< MRadialVelocity > | ArrayColumn
Public Types inherited from casacore::Measure
enum | Types { N_Types , DEFAULT }
| Each derived class should have a Types enumeration, specifying the recognised frame types. More...
typedef void * | Convert
| Each Measure should have typedefs of the form:

## Public Member Functions

| 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)
| Create from data and reference.
| 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
| Tell me your type.
Bool | giveMe (MRadialVelocity::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 radial velocity in specified units.
MDoppler | toDoppler ()
| Make a Doppler velocity (as an MDoppler::BETA default) from the RadialVelocity.
virtual Measure * | clone () const
| Make a copy.
Public Member Functions inherited from casacore::MeasBase< MVRadialVelocity, MeasRef< MRadialVelocity > >
| MeasBase ()
| 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; For reasons of compiler limitations the formal arguments had to be specified as uInt rather than the Measure enums that should be used as actual arguments; Default constructor
MeasBase< MVRadialVelocity, MeasRef< MRadialVelocity > > & | operator= (const MeasBase< MVRadialVelocity, MeasRef< MRadialVelocity > > &other)
| Copy assignment.
virtual | ~MeasBase ()
virtual Bool | areYou (const String &tp) const
| Check the type of derived entity.
virtual void | assured (const String &tp) const
| Assert that we are the correct type.
void | set (const MVRadialVelocity &dt)
| Refill the specified entities.
virtual Bool | putValue (const Vector< Quantum< Double > > &in)
MeasRef< MRadialVelocity > | getRef () const
| Get reference.
const MVRadialVelocity & | getValue () const
| Get Measure data.
const Unit & | getUnit () const
| Get Unit.
virtual MRBase * | getRefPtr () const
| Get reference pointer.
virtual const MeasValue * | getData () const
| Get pointer to data.
virtual void | print (std::ostream &os) const
| Print a Measure.
Public Member Functions inherited from casacore::Measure
virtual | ~Measure ()
| Destructor.
virtual void | set (const MeasValue &dt)=0
| Each Measure should have the following set functions (with appropiate MVs and Ref):
virtual Bool | isModel () const
| Tell me if you are a pure model (e.g.
void | dummy_giveMe () const
| Each derived class should have a string-to-code translation routine for the reference type.
void | dummy_getRef () const
| Each class should have a function to return its reference:
void | dummy_getValue () const
| Each derived class should be able to get its internal value and have:

## Static Public Member Functions

static const String & | showMe ()
static void | assure (const Measure &in)
static MRadialVelocity::Types | castType (uInt tp)
| Translate reference code.
static const String & | showType (MRadialVelocity::Types tp)
static const String & | showType (uInt tp)
static Bool | getType (MRadialVelocity::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 MDoppler | toDoppler (const Measure &in)
| Local use only.
static MRadialVelocity | fromDoppler (const MDoppler &dop)
| Make a RadialVelocity from the Doppler velocity (assuming LSRK default).
static MRadialVelocity | fromDoppler (const MDoppler &dop, MRadialVelocity::Types typ)
static MRadialVelocity | fromDoppler (const Measure &dop, MRadialVelocity::Types typ)
| For internal use only.
Static Public Member Functions inherited from casacore::Measure
static uInt | giveMe (const String &in, Int N_name, const String tname[])
| A general string checking routine to be used in derived measures.

## Friends

class | MeasConvert< MRadialVelocity >
| Conversion of data.

## Additional Inherited Members

Protected Attributes inherited from casacore::MeasBase< MVRadialVelocity, MeasRef< MRadialVelocity > >
MVRadialVelocity | data
| The measure value (e.g.
MeasRef< MRadialVelocity > | ref
| Reference frame data.
Unit | unit
| Possible input units.

## Detailed Description

A Measure: radial velocity

### Intended use:

Public interface

### Review Status

Reviewed By:
  UNKNOWN
Date Reviewed:
  before2004/08/25
Test programs:
  tMeasure

### Prerequisite

- Measure class

### 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:

- velocity (e.g. AU/a)

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

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;
casacore::MDoppler::Convert
MeasConvert< MDoppler > Convert
Measure Convert (i.e.
Definition MDoppler.h:165
casacore::MDoppler::Z
@ Z
Definition MDoppler.h:148
casacore::MRadialVelocity::toDoppler
MDoppler toDoppler()
Make a Doppler velocity (as an MDoppler::BETA default) from the RadialVelocity.
casacore::MRadialVelocity::TOPO
@ TOPO
Definition MRadialVelocity.h:154
casacore::MRadialVelocity::MRadialVelocity
MRadialVelocity()
Tip: In the following constructors and other functions, all MeasRef can be replaced with simple Measu...
casacore::Quantity
Quantum< Double > Quantity
Definition Quantum.h:39

### Motivation

Definition at line 134 of file MRadialVelocity.h.

## Member Typedef Documentation

## ArrayColumn

typedef ArrayMeasColumn<MRadialVelocity> casacore::MRadialVelocity::ArrayColumn

Definition at line 175 of file MRadialVelocity.h.

## Convert

typedef MeasConvert<MRadialVelocity> casacore::MRadialVelocity::Convert

Measure conversion use (i.e.

MRadialVelocity::Convert)

Definition at line 172 of file MRadialVelocity.h.

## MCType

typedef MCRadialVelocity casacore::MRadialVelocity::MCType

Measure conversion routines for this class (i.e.

MRadialVelocity::MCType)

Definition at line 168 of file MRadialVelocity.h.

## MVType

typedef MVRadialVelocity casacore::MRadialVelocity::MVType

Measure value container for this class (i.e.

MRadialVelocity::MVType)

Definition at line 166 of file MRadialVelocity.h.

## Ref

typedef MeasRef<MRadialVelocity> casacore::MRadialVelocity::Ref

Measure reference (i.e.

MRadialVelocity::Ref)

Definition at line 170 of file MRadialVelocity.h.

## ScalarColumn

typedef ScalarMeasColumn<MRadialVelocity> casacore::MRadialVelocity::ScalarColumn

Measure table Columns (e.g., MRadialVelocity::ScalarColumn).

Definition at line 174 of file MRadialVelocity.h.

## Member Enumeration Documentation

## Types

enum casacore::MRadialVelocity::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();
.

Enumerator
LSRK |
LSRD |
BARY |
GEO |
TOPO |
GALACTO |
LGROUP |
CMB |
N_Types |
DEFAULT | Defaults.
LSR | Synonyms.

Definition at line 149 of file MRadialVelocity.h.

## Constructor & Destructor Documentation

## MRadialVelocity() [1/9]

casacore::MRadialVelocity::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

Referenced by fromDoppler(), fromDoppler(), fromDoppler(), and MeasConvert< MRadialVelocity >.

## MRadialVelocity() [2/9]

casacore::MRadialVelocity::MRadialVelocity | ( | const MVRadialVelocity & | dt | ) |

Create from data and reference.

## MRadialVelocity() [3/9]

casacore::MRadialVelocity::MRadialVelocity | ( | const MVRadialVelocity & | dt,
|  | const MRadialVelocity::Ref & | rf )

## MRadialVelocity() [4/9]

casacore::MRadialVelocity::MRadialVelocity | ( | const MVRadialVelocity & | dt,
|  | MRadialVelocity::Types | rf )

## MRadialVelocity() [5/9]

casacore::MRadialVelocity::MRadialVelocity | ( | const Quantity & | dt | ) |

## MRadialVelocity() [6/9]

casacore::MRadialVelocity::MRadialVelocity | ( | const Quantity & | dt,
|  | const MRadialVelocity::Ref & | rf )

## MRadialVelocity() [7/9]

casacore::MRadialVelocity::MRadialVelocity | ( | const Quantity & | dt,
|  | MRadialVelocity::Types | rf )

## MRadialVelocity() [8/9]

casacore::MRadialVelocity::MRadialVelocity | ( | const Measure * | dt | ) |

## MRadialVelocity() [9/9]

casacore::MRadialVelocity::MRadialVelocity | ( | const MeasValue * | dt | ) |

## ~MRadialVelocity()

virtual casacore::MRadialVelocity::~MRadialVelocity | ( |  | ) |

virtual

## Member Function Documentation

## allMyTypes()

const String * casacore::MRadialVelocity::allMyTypes | ( | Int & | nall,
|  | Int & | nextra,
|  | const uInt *& | typ )

static

## allTypes()

virtual const String * casacore::MRadialVelocity::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 casacore::Measure.

## assure()

void casacore::MRadialVelocity::assure | ( | const Measure & | in | ) |

static

## castType()

MRadialVelocity::Types casacore::MRadialVelocity::castType | ( | uInt | tp | ) |

static

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

## checkMyTypes()

void casacore::MRadialVelocity::checkMyTypes | ( |  | ) |

static

## checkTypes()

virtual void casacore::MRadialVelocity::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.

### Thrown Exceptions

- AipsError if a (programming) error in the types.

Implements casacore::Measure.

## clone()

virtual Measure * casacore::MRadialVelocity::clone | ( |  | ) | const

virtual

Make a copy.

Implements casacore::Measure.

## fromDoppler() [1/3]

MRadialVelocity casacore::MRadialVelocity::fromDoppler | ( | const MDoppler & | dop | ) |

static

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

References MRadialVelocity().

## fromDoppler() [2/3]

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

static

References MRadialVelocity().

## fromDoppler() [3/3]

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

static

For internal use only.

References MRadialVelocity().

## get()

Quantity casacore::MRadialVelocity::get | ( | const Unit & | un | ) | const

Get radial velocity in specified units.

## getDefaultType()

virtual const String & casacore::MRadialVelocity::getDefaultType | ( |  | ) | const

virtual

Get the default reference type.

Implements casacore::Measure.

## getRefString()

virtual String casacore::MRadialVelocity::getRefString | ( |  | ) | const

virtual

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

Implements casacore::Measure.

## getType()

Bool casacore::MRadialVelocity::getType | ( | MRadialVelocity::Types & | tp,
|  | const String & | in )

static

Translate string to reference code.

## giveMe()

Bool casacore::MRadialVelocity::giveMe | ( | MRadialVelocity::Ref & | mr,
|  | const String & | in )

## setOffset()

virtual Bool casacore::MRadialVelocity::setOffset | ( | const Measure & | in | ) |

virtual

Set the offset in the reference (False if non-matching Measure).

Implements casacore::Measure.

## setRefString()

virtual Bool casacore::MRadialVelocity::setRefString | ( | const String & | in | ) |

virtual

Set the reference type to the specified String.

False if illegal string, reference set to DEFAULT.

Implements casacore::Measure.

## showMe()

const String & casacore::MRadialVelocity::showMe | ( |  | ) |

static

## showType() [1/2]

const String & casacore::MRadialVelocity::showType | ( | MRadialVelocity::Types | tp | ) |

static

## showType() [2/2]

const String & casacore::MRadialVelocity::showType | ( | uInt | tp | ) |

static

## tellMe()

virtual const String & casacore::MRadialVelocity::tellMe | ( |  | ) | const

virtual

Tell me your type.

Implements casacore::Measure.

## toDoppler() [1/2]

MDoppler casacore::MRadialVelocity::toDoppler | ( |  | ) |

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

## toDoppler() [2/2]

MDoppler casacore::MRadialVelocity::toDoppler | ( | const Measure & | in | ) |

static

Local use only.

## Friends And Related Symbol Documentation

## MeasConvert< MRadialVelocity >

friend class MeasConvert< MRadialVelocity >

friend

Conversion of data.

Definition at line 1 of file MRadialVelocity.h.

References MRadialVelocity().

The documentation for this class was generated from the following file:

- measures/Measures/MRadialVelocity.h