MDirection.h

Classes

MDirection -- A Measure: astronomical direction (full description)

class MDirection : public MeasBase<MVDirection, MeasRef<MDirection> >

Types

enum Types

J2000
JMEAN
JTRUE
APP
B1950
BMEAN
BTRUE
GALACTIC
HADEC
AZEL
AZELSW
AZELGEO
AZELSWGEO
JNAT
ECLIPTIC
MECLIPTIC
TECLIPTIC
SUPERGAL
ITRF
TOPO
ICRS
N_Types
MERCURY = 32
Planets. First one should be Mercury
VENUS
MARS
JUPITER
SATURN
URANUS
NEPTUNE
PLUTO
SUN
MOON
COMET
Comet or other table-described solar system body
N_Planets
EXTRA = 32
All extra bits
DEFAULT = J2000,
Defaults
AZELNE = AZEL,
Synonyms Synonyms

enum GlobalTypes

GRADEC
GHADEC
GAZEL
GLONGLAT
N_GTypes

Interface

Public Members
typedef WHATEVER_SUN_TYPEDEF(MDirection) Types Types
MDirection()
MDirection(const MVDirection &dt)
MDirection(const MVDirection &dt, const MDirection::Ref &rf)
MDirection(const MVDirection &dt, MDirection::Types rf)
MDirection(const Quantity &dt, const Quantity &dt1)
MDirection(const Quantity &dt, const Quantity &dt1, const MDirection::Ref &rf)
MDirection(const Quantity &dt, const Quantity &dt1, MDirection::Types rf)
MDirection(const Quantum<Vector<Double> > &dt)
MDirection(const Quantum<Vector<Double> > &dt, const MDirection::Ref &rf)
MDirection(const Quantum<Vector<Double> > &dt, MDirection::Types rf)
MDirection(const Measure *dt)
MDirection(const MeasValue *dt)
MDirection(const MDirection::Ref &rf)
MDirection(MDirection::Types rf)
virtual ~MDirection()
virtual const String &tellMe() const
static const String &showMe()
virtual uInt type() const
static void assure(const Measure &in)
static MDirection::GlobalTypes globalType(uInt tp)
static MDirection::Types castType(uInt tp)
static const String &showType(MDirection::Types tp)
static const String &showType(uInt tp)
static Bool getType(MDirection::Types &tp, const String &in)
Bool giveMe(MDirection::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()
virtual Bool isModel() const
Quantum<Vector<Double> > getAngle() const
Quantum<Vector<Double> > getAngle(const Unit &inunit) const
void shift(const Quantum<Double> &lng, const Quantum<Double> &lat, Bool trueAngle=False)
void shift(Double lng, Double lat, Bool trueAngle=False)
void shiftLongitude(const Quantity &lng, Bool trueAngle=False)
void shiftLongitude(Double lng, Bool trueAngle=False)
void shiftLatitude(const Quantum<Double> &lat, Bool trueAngle=False)
void shiftLatitude(Double lat, Bool trueAngle=False)
void shift(const MVDirection &shft, Bool trueAngle=False)
void shiftAngle(const Quantum<Double> &off, const Quantum<Double> &pa)
void shiftAngle(Double off, Double pa)
virtual Measure *clone() const

Description

Review Status

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

Prerequisite

Etymology

Synopsis

MDirection forms a derived Measure class for a direction in space.
An MDirection can be generated from a MVDirection or a pair of Quantities specifying a longitudinal and a latitudinal angle.
The different reference types that can be used for a Direction are:

Conversion between the different types is done with the standard MeasConvert class (MDirection::Convert in this case).
For some conversion additional MeasFrame information is essential. The following list specifies which information is needed if the conversion goes to or from the different types:

Conversions are based on the IAU system of precession and nutation (with IERS corrections if available); and on series expansions of the DE200 planetary ephemeris (J system; for B sytem older expansions) for the aberration and the solar position.
The HADEC position has corrections for polar motion and the equation of equinoxes; the AZEL will include Earth tides and refraction at a later stage.
Note that conversion between B1950 and J2000 can only be approximate, and is based on FK4 to FK% conversion. The best conversion is to convert first to an apparent position at the time of observation, and convert from there to the other standard (the correct route will be followed).
Another problem can arise if the source has proper motion and/or radial velocities. These should be taken into account. An MCatalog class will maybe take care of that.
Warning The offset that can be specified in the MDirection::Ref is an MDIrection offset, and can not be used for specifying angular offsets. shift() methods are available for these cases.

To aid in formatting of the angles without having to check all difference referencetypes, the following global types are provided:

they can be obtained with the globalType() method.

Example

See Measures module description for extensive examples.

Motivation

To Do

Member Description

enum Types

Types of known MDirections

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

enum GlobalTypes

Global types

typedef WHATEVER_SUN_TYPEDEF(MDirection) Types Types

Reference enum Types (included originally for gcc 2.95)

MDirection()

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 the J2000 pole direction

MDirection(const MVDirection &dt)
MDirection(const MVDirection &dt, const MDirection::Ref &rf)
MDirection(const MVDirection &dt, MDirection::Types rf)
MDirection(const Quantity &dt, const Quantity &dt1)
MDirection(const Quantity &dt, const Quantity &dt1, const MDirection::Ref &rf)
MDirection(const Quantity &dt, const Quantity &dt1, MDirection::Types rf)
MDirection(const Quantum<Vector<Double> > &dt)
MDirection(const Quantum<Vector<Double> > &dt, const MDirection::Ref &rf)
MDirection(const Quantum<Vector<Double> > &dt, MDirection::Types rf)
MDirection(const Measure *dt)
MDirection(const MeasValue *dt)
MDirection(const MDirection::Ref &rf)
MDirection(MDirection::Types rf)

Create from data and reference

virtual ~MDirection()

virtual const String &tellMe() const
static const String &showMe()

Tell me your type ('Direction')

virtual uInt type() const

Tell me your reference type (as Register())

static void assure(const Measure &in)

Assert you are a direction

static MDirection::GlobalTypes globalType(uInt tp)

Tell me the global type (like GRADEC) for tp (tp like MDirection::J2000)

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

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

Thrown Exceptions

static Bool getType(MDirection::Types &tp, const String &in)
Bool giveMe(MDirection::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)

virtual Bool isModel() const

Tell me if you are a pure model (e.g. a planet)

Quantum<Vector<Double> > getAngle() const
Quantum<Vector<Double> > getAngle(const Unit &inunit) const

Get Measure data

void shift(const Quantum<Double> &lng, const Quantum<Double> &lat, Bool trueAngle=False)
void shift(Double lng, Double lat, Bool trueAngle=False)
void shiftLongitude(const Quantity &lng, Bool trueAngle=False)
void shiftLongitude(Double lng, Bool trueAngle=False)
void shiftLatitude(const Quantum<Double> &lat, Bool trueAngle=False)
void shiftLatitude(Double lat, Bool trueAngle=False)
void shift(const MVDirection &shft, Bool trueAngle=False)

Shift the direction in longitude (radians if Double) and/or latitude. If the trueAngle switch is True, the longitude shift will be in angular units perpendicular to the direction to pole, along a great circle. See MVDirection for more details.

void shiftAngle(const Quantum<Double> &off, const Quantum<Double> &pa)
void shiftAngle(Double off, Double pa)

Shift over an angle off in the direction pa. pa is measured from North, in the direction of increasing longitude. See MVDirection for implementation.

virtual Measure *clone() const

Make a copy