casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
MBaseline.h
Go to the documentation of this file.
00001 //# MBaseline.h: A Measure: Baseline on Earth
00002 //# Copyright (C) 1998-2000,2002,2004,2007
00003 //# Associated Universities, Inc. Washington DC, USA.
00004 //#
00005 //# This library is free software; you can redistribute it and/or modify it
00006 //# under the terms of the GNU Library General Public License as published by
00007 //# the Free Software Foundation; either version 2 of the License, or (at your
00008 //# option) any later version.
00009 //#
00010 //# This library is distributed in the hope that it will be useful, but WITHOUT
00011 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00012 //# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
00013 //# License for more details.
00014 //#
00015 //# You should have received a copy of the GNU Library General Public License
00016 //# along with this library; if not, write to the Free Software Foundation,
00017 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
00018 //#
00019 //# Correspondence concerning AIPS++ should be addressed as follows:
00020 //#        Internet email: aips2-request@nrao.edu.
00021 //#        Postal address: AIPS++ Project Office
00022 //#                        National Radio Astronomy Observatory
00023 //#                        520 Edgemont Road
00024 //#                        Charlottesville, VA 22903-2475 USA
00025 //#
00026 //#
00027 //# $Id: MBaseline.h 21298 2012-12-07 14:53:03Z gervandiepen $
00028 
00029 #ifndef MEASURES_MBASELINE_H
00030 #define MEASURES_MBASELINE_H
00031 
00032 //# Includes
00033 #include <casa/aips.h>
00034 #include <measures/Measures/MeasBase.h>
00035 #include <measures/Measures/MDirection.h>
00036 #include <measures/Measures/MeasRef.h>
00037 #include <casa/Quanta/MVBaseline.h>
00038 
00039 namespace casa { //# NAMESPACE CASA - BEGIN
00040 
00041 //# Forward Declarations
00042 class MBaseline;
00043 class MCBaseline;
00044 template <class M> class MeasConvert;
00045 template <class M> class ArrayMeasColumn;
00046 template <class M> class ScalarMeasColumn;
00047 
00048 //# Typedefs
00049 
00050 // <summary> A Measure: Baseline on Earth </summary>
00051 
00052 // <use visibility=export>
00053 
00054 // <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="tMBaseline" demos="">
00055 // </reviewed>
00056 
00057 // <prerequisite>
00058 //   <li> <linkto class=Measure>Measure</linkto> class 
00059 // </prerequisite>
00060 //
00061 // <etymology>
00062 // From Measure and Baseline
00063 // </etymology>
00064 //
00065 // <synopsis>
00066 // MBaseline forms derived Measure class for an interferometer baseline.
00067 // Baselines can be given in any of the direction types, or as ITRF, the 
00068 // IERS base.<br>
00069 // Note that at the moment no correction for Earth tides (error <~ 0.05 mm/km
00070 // EW baseline), plate motion (not relevant for telescopes on same plate) and
00071 // relativistic effects are incorporated. B1950 has the same caveat as in
00072 // <linkto class=MDirection>MDirection</linkto>.
00073 // </synopsis>
00074 //
00075 // <example>
00076 // </example>
00077 //
00078 // <motivation>
00079 // </motivation>
00080 //
00081 // <todo asof="2000/06/15">
00082 //      <li> add some Earth tide model
00083 // </todo>
00084 
00085 class MBaseline : public MeasBase<MVBaseline, MeasRef<MBaseline> > {
00086 
00087  public:
00088   //# Friends
00089   // Conversion of data
00090   friend class MeasConvert<MBaseline>;
00091 
00092   //# Enumerations
00093   // Types of known MBaselines
00094   // <note role=warning>
00095   // The order defines the order in the translation matrix FromTo
00096   // in the getConvert routine. Do not change the order without
00097   // changing the array. Additions should be made before N_types, and
00098   // an additional row and column should be coded in FromTo, and
00099   // in showType().</note>
00100   enum Types {
00101     J2000,
00102     JMEAN,
00103     JTRUE,
00104     APP,
00105     B1950,
00106     B1950_VLA,
00107     BMEAN,
00108     BTRUE,
00109     GALACTIC,
00110     HADEC,
00111     AZEL,
00112     AZELSW,
00113     AZELGEO,
00114     AZELSWGEO,
00115     JNAT,
00116     ECLIPTIC,  
00117     MECLIPTIC,
00118     TECLIPTIC,
00119     SUPERGAL,
00120     ITRF,
00121     TOPO,
00122     ICRS,
00123     N_Types,
00124     // Defaults
00125     DEFAULT=ITRF,
00126     // Synonyms
00127     AZELNE=AZEL,
00128     AZELNEGEO=AZELGEO };
00129 
00130   //# Typedefs
00131   // Measure value container for this class (i.e. MBaseline::MVType)
00132   typedef MVBaseline MVType;
00133   // Measure conversion routines for this class (i.e. MBaseline::MCType)
00134   typedef MCBaseline MCType;
00135   // Measure reference (i.e. MBaseline::Ref)
00136   typedef MeasRef<MBaseline> Ref;
00137   // Measure Convert (i.e. MBaseline::Convert)
00138   typedef MeasConvert<MBaseline> Convert;
00139   // Measure table Columns (e.g., MBaseline::ScalarColumn)
00140   typedef ScalarMeasColumn<MBaseline> ScalarColumn;
00141   typedef ArrayMeasColumn<MBaseline> ArrayColumn;
00142   // Reference enum Types (included originally for gcc 2.95)  
00143   typedef WHATEVER_SUN_TYPEDEF(MBaseline) Types Types;
00144 
00145 //# Constructors
00146 // <note role=tip> In the following constructors and other functions, all 
00147 // <em>MeasRef</em> can be replaced with simple <src>Measure::TYPE</src>
00148 // where no offsets or frames are needed in the reference. </note>
00149 // Default constructor; generates the ITRF centre
00150     MBaseline();
00151 // Create from data and reference
00152 // <group>
00153     MBaseline(const MVBaseline &dt);
00154     MBaseline(const MVBaseline &dt, const MBaseline::Ref &rf);
00155     MBaseline(const MVBaseline &dt, MBaseline::Types rf);
00156     MBaseline(const Measure *dt);
00157     MBaseline(const MeasValue *dt);
00158 // </group>
00159 
00160   // <group>
00161   MBaseline(const MBaseline &);
00162   MBaseline &operator=(const MBaseline &);
00163   // </group>
00164 
00165 //# Destructor
00166     virtual ~MBaseline();
00167 
00168 //# Operators
00169 
00170 //# General Member Functions
00171 // Tell me your type
00172 // <group>
00173     virtual const String &tellMe() const;
00174     static const String &showMe();
00175     virtual uInt type() const;
00176     static void assure(const Measure &in);
00177 // </group>
00178   // Translate reference code. The uInt version has a check for valid codes
00179   // (i.e. it is a safe cast).
00180   // <thrown>
00181   //   <li> AipsError in the uInt interface if illegal code given
00182   // </thrown>
00183   // <group>
00184   static MBaseline::Types castType(uInt tp);
00185   static const String &showType(MBaseline::Types tp);
00186   static const String &showType(uInt tp);
00187   // </group>
00188   // Translate string to reference code
00189   // <group>
00190   static Bool getType(MBaseline::Types &tp, const String &in);
00191   Bool giveMe(MBaseline::Ref &mr, const String &in);
00192 // </group>
00193   // Set the offset in the reference (False if non-matching Measure)
00194   virtual Bool setOffset(const Measure &in);
00195   // Set the reference type to the specified String. False if illegal
00196   // string, reference set to DEFAULT.
00197   virtual Bool setRefString(const String &in);
00198   // Get the default reference type
00199   virtual const String &getDefaultType() const;
00200   // Get a list of all known reference codes. nall returns the number in list,
00201   // nextra the number of specials (like planets) that should be at 
00202   // end of list). typ returns the list of corresponding types.
00203   // <group>
00204   virtual const String* allTypes(Int &nall, Int &nextra,
00205                                  const uInt *&typ) const;
00206   static const String* allMyTypes(Int &nall, Int &nextra,
00207                                   const uInt *&typ);
00208   // </group>
00209   // Check if all internal tables of types (both enum and String) are 
00210   // complete and correct. This function is called automatically if and when
00211   // necessary.
00212   // <thrown>
00213   //   <li> AipsError if a (programming) error in the types.
00214   // </thrown>
00215   // <group> 
00216   virtual void checkTypes() const;
00217   static void checkMyTypes();
00218   // </group>
00219   // Get the correct MBaseline type from a given direction type (or v.v.)
00220   // <group>
00221   static MBaseline::Types fromDirType(const MDirection::Types in);
00222   static MDirection::Types toDirType(const MBaseline::Types in);
00223   // </group>
00224   // Get the reference type (for records, including codes like R_)
00225   virtual String getRefString() const;
00226   // Get my type (as Register)
00227   static uInt myType();
00228 
00229 // Get Measure data
00230 // <group>
00231     Quantum<Vector<Double> > get(const Unit &inunit) const;
00232     Quantum<Vector<Double> > getAngle() const;
00233     Quantum<Vector<Double> > getAngle(const Unit &inunit) const;
00234 // </group>
00235 
00236 // Make copy
00237 // <group>
00238     virtual Measure *clone() const;
00239 // </group>
00240 
00241 private:
00242 //# Enumerations
00243 
00244 //# Data
00245 
00246 //# Member functions
00247 
00248 };
00249 
00250 
00251 } //# NAMESPACE CASA - END
00252 
00253 #endif