Документ взят из кэша поисковой машины. Адрес
оригинального документа
: http://www.atnf.csiro.au/computing/software/casacore/casacore-1.2.0/doc/html/MEarthMagnetic_8h_source.html
Дата изменения: Unknown Дата индексирования: Mon Feb 14 21:41:58 2011 Кодировка: Поисковые слова: п п п п п п п п п п п п п п п п п п п п п п п п п |
00001 //# MEarthMagnetic.h: A Measure: Magnetic field on Earth 00002 //# Copyright (C) 1995-1999,2000,2002,2004 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: MEarthMagnetic.h 20615 2009-06-09 02:16:01Z Malte.Marquarding $ 00028 00029 #ifndef MEASURES_MEARTHMAGNETIC_H 00030 #define MEASURES_MEARTHMAGNETIC_H 00031 00032 //# Includes 00033 #include <casa/aips.h> 00034 #include <measures/Measures/MeasBase.h> 00035 #include <measures/Measures/MeasRef.h> 00036 #include <casa/Quanta/MVEarthMagnetic.h> 00037 00038 namespace casa { //# NAMESPACE CASA - BEGIN 00039 00040 //# Forward Declarations 00041 class MEarthMagnetic; 00042 class MCEarthMagnetic; 00043 template <class M> class MeasConvert; 00044 template <class M> class ArrayMeasColumn; 00045 template <class M> class ROArrayMeasColumn; 00046 template <class M> class ScalarMeasColumn; 00047 template <class M> class ROScalarMeasColumn; 00048 00049 //# Typedefs 00050 00051 // <summary> A Measure: Magnetic field on Earth </summary> 00052 00053 // <use visibility=export> 00054 00055 // <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="" demos=""> 00056 // </reviewed> 00057 00058 // <prerequisite> 00059 // <li> <linkto class=Measure>Measure</linkto> class 00060 // </prerequisite> 00061 // 00062 // <etymology> 00063 // Earth and Magnetic field 00064 // </etymology> 00065 // 00066 // <synopsis> 00067 // MEarthMagnetic forms derived Measure class for Earth' magnetic flux density. 00068 // The field can be specified as a model, or as a 3D vector (see 00069 // <linkto class=MVEarthMagnetic>MVEarthMagnetic</linkto>) with a specified 00070 // reference frame code. If a model is specified, a possibly specified 00071 // explicit field will be ignored, since the field will be calculated from 00072 // the model if a conversion is asked for.<br> 00073 // The class contains the following magnetic field models: 00074 // <ul> 00075 // <li> IGRF international reference field 00076 // </ul> 00077 // The reference frame type can be any of the types specified in the 00078 // <linkto class=MDirection>MDirection</linkto> direction types (e.g. AZEL). 00079 // <note role=warning> 00080 // The IGRF needs a Table of coefficients (at 5-year interval) </note> 00081 // 00082 // Conversion between field models is not supported (but not relevant 00083 // anyway with only one model supported). Conversion to an explicit direction 00084 // is done by the standard <linkto class=MeasConvert>MeasConvert</linkto> 00085 // class and rules (see example) using <em>MEarthMagnetic::Convert</em>, 00086 // and the reference types (e.g. MEarthMagnetic::AZEL). 00087 // 00088 // An <linkto class=EarthMagneticMachine> EarthMagneticMachine</linkto> has 00089 // been provided to get e.g. the field in a certain direction at a 00090 // certain height. 00091 // 00092 // </synopsis> 00093 // 00094 // <example> 00095 // <srcblock> 00096 // // Where on Earth 00097 // MPosition pos(MVPosition(Quantity(20,'m'), Quantity(5,'deg'), 00098 // Quantity(52,'deg')), MPosition::WGS84); 00099 // // Time we want it 00100 // MEpoch epo(MVEpoch(50000)); 00101 // // Put in frame 00102 // MeasFrame frame(pos, epo); 00103 // // Magnetic field model 00104 // MEarthMagnetic mf; 00105 // // Show field strength in Gauss in AzEl system 00106 // cout << 00107 // MEarthMagnetic::Convert(mf, MEarthMagnetic::AZEL)(). 00108 // getValue().getLength("G") << endl; 00109 // </srcblock> 00110 // </example> 00111 // 00112 // <motivation> 00113 // To have the Earth' magnetic field in the standard Measure environment. 00114 // </motivation> 00115 // 00116 // <todo asof="2000/06/15"> 00117 // <li> maybe add other field models if necessary (e.g. dipole) 00118 // </todo> 00119 00120 class MEarthMagnetic : public MeasBase<MVEarthMagnetic, MeasRef<MEarthMagnetic> > { 00121 00122 public: 00123 //# Friends 00124 // Conversion of data 00125 friend class MeasConvert<MEarthMagnetic>; 00126 00127 //# Enumerations 00128 // Types of known MEarthMagnetics 00129 // <note role=tip> The order defines the order in the translation matrix 00130 // FromTo 00131 // in the getConvert routine in MCEarthMagnetic. Do not change the order 00132 // without changing the array. Additions should be made before N_types, and 00133 // an additional row and column should be coded in FromTo, and 00134 // in showType().</note> 00135 enum Types { 00136 J2000, 00137 JMEAN, 00138 JTRUE, 00139 APP, 00140 B1950, 00141 BMEAN, 00142 BTRUE, 00143 GALACTIC, 00144 HADEC, 00145 AZEL, 00146 AZELSW, 00147 AZELGEO, 00148 AZELSWGEO, 00149 JNAT, 00150 ECLIPTIC, 00151 MECLIPTIC, 00152 TECLIPTIC, 00153 SUPERGAL, 00154 ITRF, 00155 TOPO, 00156 ICRS, 00157 N_Types, 00158 // Models. First one should be IGRF 00159 IGRF = 32, 00160 N_Models, 00161 // All extra bits (for internal use only) 00162 EXTRA = 32, 00163 // Defaults 00164 DEFAULT=IGRF, 00165 // Synonyms 00166 AZELNE=AZEL, 00167 AZELNEGEO=AZELGEO 00168 }; 00169 00170 //# Typedefs 00171 // Measure value container for this class (i.e. MEarthMagnetic::MVType) 00172 typedef MVEarthMagnetic MVType; 00173 // Measure conversion routines for this class (i.e. MEarthMagnetic::MCType) 00174 typedef MCEarthMagnetic MCType; 00175 // Measure reference (i.e. MEarthMagnetic::Ref) 00176 typedef MeasRef<MEarthMagnetic> Ref; 00177 // Measure Convert (i.e. MEarthMagnetic::Convert) 00178 typedef MeasConvert<MEarthMagnetic> Convert; 00179 // Measure table Columns (e.g., MEarthMagnetic::ROScalarColumn) 00180 typedef ROScalarMeasColumn<MEarthMagnetic> ROScalarColumn; 00181 typedef ScalarMeasColumn<MEarthMagnetic> ScalarColumn; 00182 typedef ROArrayMeasColumn<MEarthMagnetic> ROArrayColumn; 00183 typedef ArrayMeasColumn<MEarthMagnetic> ArrayColumn; 00184 // Reference enum Types (included originally for gcc 2.95) 00185 typedef WHATEVER_SUN_TYPEDEF(MEarthMagnetic) Types Types; 00186 00187 //# Constructors 00188 // <note> In the following constructors and other functions, all 00189 // <em>MeasRef</em> can be replaced with simple <src>Measure::TYPE</src> 00190 // where no offsets or frames are needed in the reference. </note> 00191 // Default constructor; generates the default IGRF type 00192 MEarthMagnetic(); 00193 // Create from data and reference 00194 // <group> 00195 MEarthMagnetic(const MVEarthMagnetic &dt); 00196 MEarthMagnetic(const MVEarthMagnetic &dt, const MEarthMagnetic::Ref &rf); 00197 MEarthMagnetic(const MVEarthMagnetic &dt, MEarthMagnetic::Types rf); 00198 MEarthMagnetic(const Measure *dt); 00199 MEarthMagnetic(const MeasValue *dt); 00200 MEarthMagnetic(const MEarthMagnetic::Ref &rf); 00201 // </group> 00202 00203 // <group> 00204 MEarthMagnetic(const MEarthMagnetic &); 00205 MEarthMagnetic &operator=(const MEarthMagnetic &); 00206 // </group> 00207 00208 //# Destructor 00209 virtual ~MEarthMagnetic(); 00210 00211 //# Operators 00212 00213 //# General Member Functions 00214 // Tell me your type 00215 // <group> 00216 virtual const String &tellMe() const; 00217 static const String &showMe(); 00218 virtual uInt type() const; 00219 static void assure(const Measure &in); 00220 // </group> 00221 // Translate reference code. The uInt version has a check for valid codes 00222 // (i.e. it is a safe cast). 00223 // <thrown> 00224 // <li> AipsError in the uInt interface if illegal code given 00225 // </thrown> 00226 // <group> 00227 static MEarthMagnetic::Types castType(uInt tp); 00228 static const String &showType(MEarthMagnetic::Types tp); 00229 static const String &showType(uInt tp); 00230 // </group> 00231 // Translate string to reference code 00232 // <group> 00233 static Bool getType(MEarthMagnetic::Types &tp, const String &in); 00234 Bool giveMe(MEarthMagnetic::Ref &mr, const String &in); 00235 // </group> 00236 // Set the offset in the reference (False if non-matching Measure) 00237 virtual Bool setOffset(const Measure &in); 00238 // Set the reference type to the specified String. False if illegal 00239 // string, reference set to DEFAULT. 00240 virtual Bool setRefString(const String &in); 00241 // Get the default reference type 00242 virtual const String &getDefaultType() const; 00243 // Get a list of all known reference codes. nall returns the number in list, 00244 // nextra the number of specials (like planets) that should be at 00245 // end of list). typ returns the list of corresponding types. 00246 // <group> 00247 virtual const String* allTypes(Int &nall, Int &nextra, 00248 const uInt *&typ) const; 00249 static const String* allMyTypes(Int &nall, Int &nextra, 00250 const uInt *&typ); 00251 // </group> 00252 // Check if all internal tables of types (both enum and String) are 00253 // complete and correct. This function is called automatically if and when 00254 // necessary. 00255 // <thrown> 00256 // <li> AipsError if a (programming) error in the types. 00257 // </thrown> 00258 // <group> 00259 virtual void checkTypes() const; 00260 static void checkMyTypes(); 00261 // </group> 00262 // Get the reference type (for records, including codes like R_) 00263 virtual String getRefString() const; 00264 // Get my type (as Register) 00265 static uInt myType(); 00266 // Tell me if you are a pure model (e.g. a planet) 00267 virtual Bool isModel() const; 00268 00269 // Get Measure data 00270 // <group> 00271 Quantum<Vector<Double> > get(const Unit &inunit) const; 00272 Quantum<Vector<Double> > getAngle() const; 00273 Quantum<Vector<Double> > getAngle(const Unit &inunit) const; 00274 // </group> 00275 00276 // Make copy 00277 virtual Measure *clone() const; 00278 00279 private: 00280 //# Enumerations 00281 00282 //# Data 00283 00284 //# Member functions 00285 00286 }; 00287 00288 00289 } //# NAMESPACE CASA - END 00290 00291 #endif