casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Types | Public Member Functions | Static Public Member Functions | Friends
casa::MDoppler Class Reference

A Measure: Doppler shift. More...

#include <MDoppler.h>

Inheritance diagram for casa::MDoppler:
casa::MeasBase< MVDoppler, MeasRef< MDoppler > > casa::Measure

List of all members.

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< MDopplerRef
 Measure reference (i.e.
typedef MeasConvert< MDopplerConvert
 Measure Convert (i.e.
typedef ScalarMeasColumn
< MDoppler
ScalarColumn
 Measure table Columns (e.g., MDoppler::ScalarColumn)
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;
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 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();.
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 StringgetDefaultType () const
 Get the default reference type.
virtual const StringallTypes (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< 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 const StringshowMe ()
static void assure (const Measure &in)
static MDoppler::Types castType (uInt tp)
 Translate reference code.
static const StringshowType (MDoppler::Types tp)
static const StringshowType (uInt tp)
static Bool getType (MDoppler::Types &tp, const String &in)
 Translate string to reference code.
static const StringallMyTypes (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.

Detailed Description

A Measure: Doppler shift.

Intended use:

Public interface

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:

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


Member Typedef Documentation

Definition at line 171 of file MDoppler.h.

Measure Convert (i.e.

MDoppler::Convert)

Reimplemented from casa::Measure.

Definition at line 168 of file MDoppler.h.

Measure conversion routines for this class (i.e.

MDoppler::MCType)

Definition at line 164 of file MDoppler.h.

Measure value container for this class (i.e.

MDoppler::MVType)

Definition at line 162 of file MDoppler.h.

Measure reference (i.e.

MDoppler::Ref)

Definition at line 166 of file MDoppler.h.

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

Definition at line 170 of file MDoppler.h.


Member Enumeration Documentation

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

Enumerator:
RADIO 
Z 
RATIO 
BETA 
GAMMA 
N_Types 
OPTICAL 
RELATIVISTIC 
DEFAULT 

Reimplemented from casa::Measure.

Definition at line 149 of file MDoppler.h.


Constructor & Destructor Documentation


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

Create from data and reference.

casa::MDoppler::MDoppler ( const MVDoppler dt,
const MDoppler::Ref rf 
)
casa::MDoppler::MDoppler ( const Quantity dt,
const MDoppler::Ref rf 
)
virtual casa::MDoppler::~MDoppler ( ) [virtual]

    


Member Function Documentation

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]

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

Thrown Exceptions

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

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.

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.

static const String& casa::MDoppler::showMe ( ) [static]
static const String& casa::MDoppler::showType ( MDoppler::Types  tp) [static]
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.

Reference enum Types (included originally for gcc 2.95)


Friends And Related Function Documentation

friend class MeasConvert< MDoppler > [friend]

Conversion of data.

Definition at line 139 of file MDoppler.h.


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