casa::MDoppler Class Reference
[Measures]

#include <MDoppler.h>

Inheritance diagram for casa::MDoppler:

Inheritance graph
[legend]
Collaboration diagram for casa::MDoppler:

Collaboration graph
[legend]
List of all members.

Detailed Description

A Measure: Doppler shift.

Intended use:

Part of API

Review Status

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

Prerequisite

Etymology

From Measure and Doppler

Synopsis

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:

None: a Doppler ratio <it> Velocity: Doppler ratio calculated by dividing with c 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.

Example

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;

Motivation

To Do

Definition at line 136 of file MDoppler.h.
virtual const StringtellMe () 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();.
static const StringshowMe ()
static void assure (const Measure &in)
Bool giveMe (MDoppler::Ref &mr, const String &in)
static Bool getType (MDoppler::Types &tp, const String &in)
 Translate string to reference code.
virtual const String *const allTypes (Int &nall, Int &nextra, const uInt *&typ) const
 Get a list of all known reference codes.
static const String *const allMyTypes (Int &nall, Int &nextra, const uInt *&typ)
virtual void checkTypes () const
 Check if all internal tables of types (both enum and String) are complete and correct.
static void checkMyTypes ()

Public Types

enum  Types
 Types of known MDopplers Warning: The order defines the order in the translation matrix FromTo in the getConvert routine. 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< MDopplerRef
 Measure reference (i.e.
typedef MeasConvert< MDopplerConvert
 Measure Convert (i.e.
typedef ROScalarMeasColumn<
MDoppler
ROScalarColumn
 Measure table Columns (e.g., MDoppler::ROScalarColumn).
typedef ScalarMeasColumn<
MDoppler
ScalarColumn
typedef ROArrayMeasColumn<
MDoppler
ROArrayColumn
typedef ArrayMeasColumn< MDopplerArrayColumn

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.
virtual ~MDoppler ()
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 StringgetDefaultType () const
 Get the default reference type.
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< DoubleshiftFrequency (const Vector< Double > &freq) const
 Shift the input frequencies to the output frequencies.
Quantum< Vector< Double > > shiftFrequency (const Quantum< Vector< Double > > &freq) const
virtual Measureclone () const
 Make a copy.

Static Public Member Functions

static uInt myType ()
 Get my type (as Register).
static MDoppler::Types castType (uInt tp)
 Translate reference code.
static const StringshowType (MDoppler::Types tp)
static const StringshowType (uInt tp)

Friends

class MeasConvert< MDoppler >
 Conversion of data.


Member Typedef Documentation

typedef MVDoppler casa::MDoppler::MVType

Measure value container for this class (i.e.

MDoppler::MVType)

Definition at line 164 of file MDoppler.h.

typedef MCDoppler casa::MDoppler::MCType

Measure conversion routines for this class (i.e.

MDoppler::MCType)

Definition at line 166 of file MDoppler.h.

typedef MeasRef<MDoppler> casa::MDoppler::Ref

Measure reference (i.e.

MDoppler::Ref)

Definition at line 168 of file MDoppler.h.

typedef MeasConvert<MDoppler> casa::MDoppler::Convert

Measure Convert (i.e.

MDoppler::Convert)

Reimplemented from casa::Measure.

Definition at line 170 of file MDoppler.h.

typedef ROScalarMeasColumn<MDoppler> casa::MDoppler::ROScalarColumn

Measure table Columns (e.g., MDoppler::ROScalarColumn).

Definition at line 172 of file MDoppler.h.

typedef ScalarMeasColumn<MDoppler> casa::MDoppler::ScalarColumn

Definition at line 173 of file MDoppler.h.

typedef ROArrayMeasColumn<MDoppler> casa::MDoppler::ROArrayColumn

Definition at line 174 of file MDoppler.h.

typedef ArrayMeasColumn<MDoppler> casa::MDoppler::ArrayColumn

Definition at line 175 of file MDoppler.h.


Member Enumeration Documentation

enum casa::MDoppler::Types

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 151 of file MDoppler.h.


Constructor & Destructor Documentation

casa::MDoppler::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

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]

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  ) 


Member Function Documentation

typedef casa::MDoppler::WHATEVER_SUN_TYPEDEF ( MDoppler   ) 

Reference enum Types (included originally for gcc 2.95).

virtual const String& casa::MDoppler::tellMe (  )  const [virtual]

Tell me your type.

Implements casa::Measure.

static const String& casa::MDoppler::showMe (  )  [static]

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.

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

Thrown Exceptions

static const String& casa::MDoppler::showType ( MDoppler::Types  tp  )  [static]

static const String& casa::MDoppler::showType ( uInt  tp  )  [static]

static Bool casa::MDoppler::getType ( MDoppler::Types tp,
const String in 
) [static]

Translate string to reference code.

Bool casa::MDoppler::giveMe ( MDoppler::Ref mr,
const String in 
)

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.

virtual const String& casa::MDoppler::getDefaultType (  )  const [virtual]

Get the default reference type.

Implements casa::Measure.

virtual const String* const 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 const String* const casa::MDoppler::allMyTypes ( Int nall,
Int nextra,
const uInt *&  typ 
) [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.

Thrown Exceptions

Implements casa::Measure.

static void casa::MDoppler::checkMyTypes (  )  [static]

virtual String casa::MDoppler::getRefString (  )  const [virtual]

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

Implements casa::Measure.

static uInt casa::MDoppler::myType (  )  [static]

Get my type (as Register).

Quantity casa::MDoppler::get ( const Unit un  )  const

Get in specified units.

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

virtual Measure* casa::MDoppler::clone (  )  const [virtual]

Make a copy.

Implements casa::Measure.


Friends And Related Function Documentation

friend class MeasConvert< MDoppler > [friend]

Conversion of data.

Definition at line 141 of file MDoppler.h.


The documentation for this class was generated from the following file:
Generated on Mon Sep 1 22:45:56 2008 for NRAOCASA by  doxygen 1.5.1