Документ взят из кэша поисковой машины. Адрес
оригинального документа
: http://www.atnf.csiro.au/computing/software/casacore/casacore-1.2.0/doc/html/MeasJPL_8h_source.html
Дата изменения: Unknown Дата индексирования: Mon Feb 14 19:55:12 2011 Кодировка: Поисковые слова: jupiter |
00001 //# MeasJPL.h: Interface to JPL DE tables 00002 //# Copyright (C) 1996,1997,1998,1999,2002 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 //# $Id: MeasJPL.h 20362 2008-06-27 04:54:24Z Malte.Marquarding $ 00027 00028 #ifndef MEASURES_MEASJPL_H 00029 #define MEASURES_MEASJPL_H 00030 00031 //# Includes 00032 #include <casa/aips.h> 00033 #include <tables/Tables/Table.h> 00034 #include <tables/Tables/TableRow.h> 00035 #include <tables/Tables/TableRecord.h> 00036 #include <tables/Tables/ArrayColumn.h> 00037 #include <casa/Containers/RecordField.h> 00038 00039 namespace casa { //# NAMESPACE CASA - BEGIN 00040 00041 //# Forward Declarations 00042 class String; 00043 class MVEpoch; 00044 00045 // <summary> Interface to JPL DE tables </summary> 00046 00047 // <use visibility=local> 00048 00049 // <reviewed reviewer="UNKNOWN" date="before2004/08/25" tests="tMeasJPL" demos=""> 00050 // </reviewed> 00051 00052 // <prerequisite> 00053 // <li> <linkto class=MeasTable>MeasTable</linkto> 00054 // </prerequisite> 00055 // 00056 // <etymology> 00057 // From Measure and JPL 00058 // </etymology> 00059 // 00060 // <synopsis> 00061 // MeasJPL is the interface class to the JPL DE planetary data. 00062 // It has only static memebers.<br> 00063 // Tables are found using the aipsrc 00064 // (using <src>measures.<table>.directory</src>) 00065 // mechanism. If not provided they are assumed to reside in standard places 00066 // (i.e. in $AIPSROOT/data/ephemerides) Tables are assumed to have the 00067 // VS_VERSION, VS_DATE, VS_CREATE and VS_TYPE keywords, and be of type IERS, 00068 // else an exception will be thrown.<br> 00069 // The <src>get()</src> method will obtain data from the JPL planetary 00070 // tables (i.e. the <src>DE200</src> and 00071 // the <src>DE405</src> tables). The data obtained will be the barycentric 00072 // position (AU) and velocity (AU/d) of planets; the nutation (rad, rad/d) 00073 // or the libration (rad, rad/d; DE405 only). All in the J2000 system.<br> 00074 // The JPL DE Tables have a large set of constants attach to it. Some 00075 // will be available by their own special code, the others their filed name. 00076 // (See the <src>get</src> functions.<br> 00077 // The enumeration code gives the available data and planets. See 00078 // E.M. Standish et al., JPL IOM 314.10 - 127 for further details. 00079 // <br> 00080 // Note that the normal usage of these tables is through the Measures system. 00081 // 00082 // <note> 00083 // A message is Logged (once) if a table cannot be found. 00084 // A message is logged (once) if a date outside the range in 00085 // the Tables is asked for. 00086 // </note> 00087 // <thrown> 00088 // <li> AipsError if table opened has wrong format or otherwise corrupted. 00089 // </thrown> 00090 // </synopsis> 00091 // 00092 // <example> 00093 // <srcblock> 00094 // #include <casa/aips.h> 00095 // #include <casa/Quanta/MVEpoch.h> 00096 // #include <measures/Measures/MeasJPL.h> 00097 // #include <casa/Arrays/Vector.h> 00098 // const MVEpoch dat = 51116; // a date (1998/10/30) in TDB 00099 // Vector<Double> val(6), valE(6); // results 00100 // // Get position and velocity of Venus (barycentric) 00101 // if (!MeasJPL::get(val, MeasJPL::DE200, MeasJPL::VENUS, dat)) { 00102 // cout << "Some error getting Venus position" << endl; 00103 // // Get Earth position and velocity (barycentric) 00104 // } else if (!MeasJPL::get(valE, MeasJPL::DE200, MeasJPL::VENUS, dat)) { 00105 // cout << "Some error getting Earth position" << endl; 00106 // } else { 00107 // cout << "Venus (geocentric): " << (val-valE) << endl; 00108 // }; 00109 // </srcblock> 00110 // </example> 00111 // 00112 // <motivation> 00113 // To use the JPL data for planetary positions and high precision nutation 00114 // </motivation> 00115 // 00116 // <todo asof="1998/08/24"> 00117 // </todo> 00118 00119 class MeasJPL { 00120 00121 public: 00122 //# Constants 00123 00124 //# Enumerations 00125 // Types of known data 00126 enum Types { 00127 // MJD (must be first in list) 00128 MJD, 00129 // Column with data 00130 X, 00131 // Number of columns 00132 N_Columns, 00133 // Planets 00134 MERCURY = 1, 00135 VENUS = 2, 00136 EARTH = 3, 00137 MARS = 4, 00138 JUPITER = 5, 00139 SATURN = 6, 00140 URANUS = 7, 00141 NEPTUNE = 8, 00142 PLUTO = 9, 00143 MOON = 10, 00144 SUN = 11, 00145 // Solar system barycentre 00146 BARYSOLAR = 12, 00147 // Earth-Moon system barycentre 00148 BARYEARTH = 13, 00149 // Nutations 00150 NUTATION = 14, 00151 // Librations 00152 LIBRATION = 15, 00153 // Number of types 00154 N_Types }; 00155 00156 // Types of files 00157 enum Files { 00158 // DE200 00159 DE200, 00160 // DE405 00161 DE405, 00162 // # of known types 00163 N_Files, 00164 // Default 00165 DEFAULT = DE200 }; 00166 00167 // Codes for special constants 00168 enum Codes { 00169 // Light velocity used in AU/d 00170 CAU, 00171 // Solar mass (GM0)/c<sup>2</sup> in AU 00172 GMS, 00173 // AU in km 00174 AU, 00175 // Solar radius in AU 00176 RADS, 00177 // # of codes 00178 N_Codes }; 00179 00180 //# General Member Functions 00181 // Get the values from a DE table, interpolated for date(in MJD(TDB)). 00182 // The file can be DE200 or DE405, the type as given in enum. 00183 static Bool get(Vector<Double> &returnValue, 00184 MeasJPL::Files file, 00185 MeasJPL::Types type, 00186 const MVEpoch &date); 00187 // Get indicated special constant 00188 static Bool getConst(Double &res, MeasJPL::Files which, 00189 MeasJPL::Codes what); 00190 // Get filed constant with name nam 00191 static Bool getConst(Double &res, MeasJPL::Files which, 00192 const String &nam); 00193 00194 // Close the set of JPL tables only 00195 static void closeMeas(); 00196 00197 private: 00198 00199 //# Constructors 00200 // Default constructor, NOT defined 00201 MeasJPL(); 00202 00203 // Copy assign, NOT defined 00204 MeasJPL &operator=(const MeasJPL &other); 00205 00206 //# Destructor 00207 // Destructor, NOT defined and not declared to stop warning 00208 // ~MeasJPL(); 00209 00210 //# General member functions 00211 // Initialise tables 00212 static Bool initMeas(MeasJPL::Files which); 00213 // Fill Table lines 00214 static Bool fillMeas(Double &intv, MeasJPL::Files which, 00215 const MVEpoch &utf); 00216 // Interpolate Chebyshev polymomial to res 00217 static void interMeas(Double res[], MeasJPL::Files which, Double intv, 00218 Double ivf, Int ncf, Int ncm, Int na, 00219 const Double buf[]); 00220 00221 //# Data members 00222 // Measured data readable 00223 static Bool measFlag[N_Files]; 00224 // Measured data present 00225 static Bool measured[N_Files]; 00226 // Tables present 00227 static Table t[N_Files]; 00228 // Row descriptions 00229 static ROTableRow row[N_Files]; 00230 // Field pointers 00231 static RORecordFieldPtr<Double> rfp[N_Files][MeasJPL::N_Types]; 00232 // First (-1) MJD in list 00233 static Int mjd0[N_Files]; 00234 // Last MJD in list 00235 static Int mjdl[N_Files]; 00236 // Increment in rows 00237 static Int dmjd[N_Files]; 00238 // Message given 00239 static Bool msgDone; 00240 // File names 00241 static const String tp[N_Files]; 00242 // Index in record 00243 static Int idx[N_Files][3][13]; 00244 // Data column descriptor 00245 static ROArrayColumn<Double> acc[N_Files]; 00246 // Data in current row 00247 static Vector<Double> dval[N_Files]; 00248 // Current row 00249 static Int ldat[N_Files]; 00250 // Chebyshev coefficients 00251 // <group> 00252 static Double chc[18]; 00253 static Double chcv[18]; 00254 // </group> 00255 // Some helper data 00256 // <group> 00257 static Double aufac[N_Files]; 00258 static Double emrat[N_Files]; 00259 static Double cn[N_Files][N_Codes]; 00260 static Int np; 00261 static Int nv; 00262 static Double twot; 00263 static Double vfac; 00264 // </group> 00265 }; 00266 00267 //# Inline Implementations 00268 00269 00270 } //# NAMESPACE CASA - END 00271 00272 #endif