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

More...

`#include <MDirection.h>`

## Public Types

enum | Types { J2000 , JMEAN , JTRUE , APP , B1950 , B1950_VLA , BMEAN , BTRUE , GALACTIC , HADEC , AZEL , AZELSW , AZELGEO , AZELSWGEO , JNAT , ECLIPTIC , MECLIPTIC , TECLIPTIC , SUPERGAL , ITRF , TOPO , ICRS , N_Types , MERCURY , VENUS , MARS , JUPITER , SATURN , URANUS , NEPTUNE , PLUTO , SUN , MOON , COMET , N_Planets , EXTRA , DEFAULT , AZELNE , AZELNEGEO }
| 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(); . More...
enum | GlobalTypes { GRADEC , GHADEC , GAZEL , GLONGLAT , N_GTypes }
| Global types. More...
typedef MVDirection | MVType
| Measure value container for this class (i.e.
typedef MCDirection | MCType
| Measure conversion routines for this class (i.e.
typedef MeasRef< MDirection > | Ref
| Measure reference (i.e.
typedef MeasConvert< MDirection > | Convert
| Measure Convert (i.e.
typedef ScalarMeasColumn< MDirection > | ScalarColumn
| Measure table Columns (e.g., MDirection::ScalarColumn).
typedef ArrayMeasColumn< MDirection > | 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

| 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)
| Create from data and reference.
| 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
| Tell me your type ('Direction').
Bool | giveMe (MDirection::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_).
virtual Bool | isModel () const
| Tell me if you are a pure model (e.g.
Quantum< Vector< Double > > | getAngle () const
| Get Measure data.
Quantum< Vector< Double > > | getAngle (const Unit &inunit) const
void | shift (const Quantum< Double > &lng, const Quantum< Double > &lat, Bool trueAngle=False)
| Shift the direction in longitude (radians if Double) and/or latitude.
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)
| Shift over an angle off in the direction pa.
void | shiftAngle (Double off, Double pa)
virtual Measure * | clone () const
| Make a copy.
String | toString () const
| Convert to a String in astronomer-friendly format based on reference frame.
Public Member Functions inherited from casacore::MeasBase< MVDirection, MeasRef< MDirection > >
| 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< MVDirection, MeasRef< MDirection > > & | operator= (const MeasBase< MVDirection, MeasRef< MDirection > > &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 MVDirection &dt)
| Refill the specified entities.
virtual Bool | putValue (const Vector< Quantum< Double > > &in)
MeasRef< MDirection > | getRef () const
| Get reference.
const MVDirection & | 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):
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 MDirection | makeMDirection (const String &sourceName)
| Make an MDirection object given the case-insensitive name of a moving source (ZENITH, SUN, etc.), or of a known standard source (CygA, etc.).
static const String & | showMe ()
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)
| Translate reference code tp.
static const String & | showType (MDirection::Types tp)
static const String & | showType (uInt tp)
static Bool | getType (MDirection::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 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< MDirection >
| Conversion of data.

## Additional Inherited Members

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

## Detailed Description

A Measure: astronomical direction

### Intended use:

Public interface

### Review Status

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

### Prerequisite

- Measure class

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

- MDirection::J2000 – mean equator and equinox at J2000.0 (FK5)
- MDirection::JNAT — geocentric natural frame
- MDirection::JMEAN – mean equator and equinox at frame epoch
- MDirection::JTRUE – true equator and equinox at frame epoch
- MDirection::APP -— apparent geocentric position
- MDirection::B1950 – mean epoch and ecliptic at B1950.0. The epoch is taken from the frame epoch; or from the aipsrc variable measures.b1950.d_epoch; or has default 2000.0
- MDirection::B1950_VLA – mean epoch(1979.9)) and ecliptic at B1950.0
- MDirection::BMEAN – mean equator and equinox at frame epoch
- MDirection::BTRUE – true equator and equinox at frame epoch
- MDirection::GALACTIC – galactic coordinates
- MDirection::HADEC – topocentric HA and declination
- MDirection::AZEL — topocentric Azimuth and Elevation (N through E)
- MDirection::AZELSW - topocentric Azimuth and Elevation (S through W)
- MDirection::AZELNE - topocentric Azimuth and Elevation (N through E)
- MDirection::AZELGEO — geodetic Azimuth and Elevation (N through E)
- MDirection::AZELSWGEO - geodetic Azimuth and Elevation (S through W)
- MDirection::AZELNEGEO - geodetic Azimuth and Elevation (N through E)
- MDirection::ECLIPTC – ecliptic for J2000 equator and equinox
- MDirection::MECLIPTIC – ecliptic for mean equator of date
- MDirection::TECLIPTIC – ecliptic for true equator of date
- MDirection::SUPERGAL – supergalactic coordinates
- MDirection::ITRF – coordinates wrt ITRF Earth frame
- MDirection::TOPO – apparent topocentric position
- MDirection::ICRS – International Celestial reference system
- MDirection::MERCURY – the planet: has no data attached
- MDirection::VENUS
- MDirection::MARS
- MDirection::JUPITER
- MDirection::SATURN
- MDirection::URANUS
- MDirection::NEPTUNE
- MDirection::PLUTO
- MDirection::SUN
- MDirection::MOON
- MDirection::COMET – solar system body: no coordinates attached, only table
- MDirection::DEFAULT = J2000

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:

- Epoch: all but J2000, B1950, GALACTIC, SUPGAL, ECLIPTIC, ICRS
- Positiom: HADEC, AZEL, AZELGEO

The conversion between B1950 and J2000 may have an Epoch. If none given an epoch of 2000.0 is assumed for the conversion, unless an aipsrc variable measures.b1950.d_epoch is given.

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

- GRADEC for types that are probably expressed in HM,DM
- GHADEC for types that are probably expressed in +-HM,DM
- GAZEL for types that are probably expressed in +-deg,deg
- GLONGLAT for types that are probably expressed in deg,deg

they can be obtained with the globalType() method.

### Example

See Measures module description for extensive examples.

### Motivation

### To Do

Definition at line 171 of file MDirection.h.

## Member Typedef Documentation

## ArrayColumn

typedef ArrayMeasColumn<MDirection> casacore::MDirection::ArrayColumn

Definition at line 249 of file MDirection.h.

## Convert

typedef MeasConvert<MDirection> casacore::MDirection::Convert

Measure Convert (i.e.

MDirection::Convert)

Definition at line 246 of file MDirection.h.

## MCType

typedef MCDirection casacore::MDirection::MCType

Measure conversion routines for this class (i.e.

MDirection::MCType)

Definition at line 242 of file MDirection.h.

## MVType

typedef MVDirection casacore::MDirection::MVType

Measure value container for this class (i.e.

MDirection::MVType)

Definition at line 240 of file MDirection.h.

## Ref

typedef MeasRef<MDirection> casacore::MDirection::Ref

Measure reference (i.e.

MDirection::Ref)

Definition at line 244 of file MDirection.h.

## ScalarColumn

typedef ScalarMeasColumn<MDirection> casacore::MDirection::ScalarColumn

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

Definition at line 248 of file MDirection.h.

## Member Enumeration Documentation

## GlobalTypes

enum casacore::MDirection::GlobalTypes

Global types.

Enumerator
GRADEC |
GHADEC |
GAZEL |
GLONGLAT |
N_GTypes |

Definition at line 231 of file MDirection.h.

## Types

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

Enumerator
J2000 |
JMEAN |
JTRUE |
APP |
B1950 |
B1950_VLA |
BMEAN |
BTRUE |
GALACTIC |
HADEC |
AZEL |
AZELSW |
AZELGEO |
AZELSWGEO |
JNAT |
ECLIPTIC |
MECLIPTIC |
TECLIPTIC |
SUPERGAL |
ITRF |
TOPO |
ICRS |
N_Types |
MERCURY | 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 | All extra bits.
DEFAULT | Defaults.
AZELNE | Synonyms.
AZELNEGEO |

Definition at line 185 of file MDirection.h.

## Constructor & Destructor Documentation

## MDirection() [1/14]

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

Referenced by makeMDirection(), and MeasConvert< MDirection >.

## MDirection() [2/14]

casacore::MDirection::MDirection | ( | const MVDirection & | dt | ) |

Create from data and reference.

## MDirection() [3/14]

casacore::MDirection::MDirection | ( | const MVDirection & | dt,
|  | const MDirection::Ref & | rf )

## MDirection() [4/14]

casacore::MDirection::MDirection | ( | const MVDirection & | dt,
|  | MDirection::Types | rf )

## MDirection() [5/14]

casacore::MDirection::MDirection | ( | const Quantity & | dt,
|  | const Quantity & | dt1 )

## MDirection() [6/14]

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

## MDirection() [7/14]

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

## MDirection() [8/14]

casacore::MDirection::MDirection | ( | const Quantum< Vector< Double > > & | dt | ) |

## MDirection() [9/14]

casacore::MDirection::MDirection | ( | const Quantum< Vector< Double > > & | dt,
|  | const MDirection::Ref & | rf )

## MDirection() [10/14]

casacore::MDirection::MDirection | ( | const Quantum< Vector< Double > > & | dt,
|  | MDirection::Types | rf )

## MDirection() [11/14]

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

## MDirection() [12/14]

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

## MDirection() [13/14]

casacore::MDirection::MDirection | ( | const MDirection::Ref & | rf | ) |

## MDirection() [14/14]

casacore::MDirection::MDirection | ( | MDirection::Types | rf | ) |

## ~MDirection()

virtual casacore::MDirection::~MDirection | ( |  | ) |

virtual

## Member Function Documentation

## allMyTypes()

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

static

## allTypes()

virtual const String * casacore::MDirection::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::MDirection::assure | ( | const Measure & | in | ) |

static

Assert you are a direction.

## castType()

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

static

Translate reference code tp.

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::MDirection::checkMyTypes | ( |  | ) |

static

## checkTypes()

virtual void casacore::MDirection::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::MDirection::clone | ( |  | ) | const

virtual

Make a copy.

Implements casacore::Measure.

## getAngle() [1/2]

Quantum< Vector< Double > > casacore::MDirection::getAngle | ( |  | ) | const

Get Measure data.

## getAngle() [2/2]

Quantum< Vector< Double > > casacore::MDirection::getAngle | ( | const Unit & | inunit | ) | const

## getDefaultType()

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

virtual

Get the default reference type.

Implements casacore::Measure.

## getRefString()

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

virtual

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

Implements casacore::Measure.

## getType()

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

static

Translate string to reference code.

## giveMe()

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

## globalType()

MDirection::GlobalTypes casacore::MDirection::globalType | ( | uInt | tp | ) |

static

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

## isModel()

virtual Bool casacore::MDirection::isModel | ( |  | ) | const

virtual

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

a planet)

Reimplemented from casacore::Measure.

## makeMDirection()

MDirection casacore::MDirection::makeMDirection | ( | const String & | sourceName | ) |

static

Make an MDirection object given the case-insensitive name of a moving source (ZENITH, SUN, etc.), or of a known standard source (CygA, etc.).

References MDirection().

## setOffset()

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

virtual

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

Implements casacore::Measure.

## setRefString()

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

virtual

Set the reference type to the specified String.

False if illegal string, reference set to DEFAULT.

Implements casacore::Measure.

## shift() [1/3]

void casacore::MDirection::shift | ( | const MVDirection & | shft,
|  | Bool | trueAngle = False )

References casacore::False.

## shift() [2/3]

void casacore::MDirection::shift | ( | const Quantum< Double > & | lng,
|  | const Quantum< Double > & | lat,
|  | 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.

References casacore::False.

## shift() [3/3]

void casacore::MDirection::shift | ( | Double | lng,
|  | Double | lat,
|  | Bool | trueAngle = False )

References casacore::False.

## shiftAngle() [1/2]

void casacore::MDirection::shiftAngle | ( | const Quantum< Double > & | off,
|  | const Quantum< 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.

References casacore::pa().

## shiftAngle() [2/2]

void casacore::MDirection::shiftAngle | ( | Double | off,
|  | Double | pa )

References casacore::pa().

## shiftLatitude() [1/2]

void casacore::MDirection::shiftLatitude | ( | const Quantum< Double > & | lat,
|  | Bool | trueAngle = False )

References casacore::False.

## shiftLatitude() [2/2]

void casacore::MDirection::shiftLatitude | ( | Double | lat,
|  | Bool | trueAngle = False )

References casacore::False.

## shiftLongitude() [1/2]

void casacore::MDirection::shiftLongitude | ( | const Quantity & | lng,
|  | Bool | trueAngle = False )

References casacore::False.

## shiftLongitude() [2/2]

void casacore::MDirection::shiftLongitude | ( | Double | lng,
|  | Bool | trueAngle = False )

References casacore::False.

## showMe()

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

static

## showType() [1/2]

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

static

## showType() [2/2]

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

static

## tellMe()

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

virtual

Tell me your type ('Direction').

Implements casacore::Measure.

## toString()

String casacore::MDirection::toString | ( |  | ) | const

Convert to a String in astronomer-friendly format based on reference frame.

## Friends And Related Symbol Documentation

## MeasConvert< MDirection >

friend class MeasConvert< MDirection >

friend

Conversion of data.

Definition at line 1 of file MDirection.h.

References MDirection().

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

- measures/Measures/MDirection.h