MDirection.h
Classes
- MDirection -- A Measure: astronomical direction (full description)
class MDirection : public MeasBase<MVDirection, MeasRef<MDirection> >
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
- 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
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:
- 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
- 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
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.
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
Member Description
Types of known MDirections
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().
Global types
Reference enum Types (included originally for gcc 2.95)
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
Create from data and reference
Tell me your type ('Direction')
virtual uInt type() const
Tell me your reference type (as Register())
Assert you are a direction
Tell me the global type (like GRADEC) for tp (tp like MDirection::J2000)
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
static Bool getType(MDirection::Types &tp, const String &in)
Bool giveMe(MDirection::Ref &mr, const String &in)
Translate string to reference code
Set the offset in the reference (False if non-matching Measure)
Set the reference type to the specified String. False if illegal
string, reference set to DEFAULT.
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.
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.
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)
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.
Make a copy