ARTS  2.2.66
m_planets.cc
Go to the documentation of this file.
1 /* Copyright (C) 2012
2  Patrick Eriksson <Patrick.Eriksson@chalmers.se>
3 
4  This program is free software; you can redistribute it and/or modify it
5  under the terms of the GNU General Public License as published by the
6  Free Software Foundation; either version 2, or (at your option) any
7  later version.
8 
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with this program; if not, write to the Free Software
16  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
17  USA. */
18 
19 
20 
21 /*===========================================================================
22  === File description
23  ===========================================================================*/
24 
39 /*===========================================================================
40  === External declarations
41  ===========================================================================*/
42 
43 #include <cmath>
44 #include <stdexcept>
45 #include "arts.h"
46 #include "check_input.h"
47 #include "matpackI.h"
48 #include "messages.h"
49 
50 
51 extern const Numeric EARTH_RADIUS;
52 extern const Numeric DEG2RAD;
53 
54 
55 // Ref. 1:
56 // Seidelmann, P. Kenneth; Archinal, B. A.; A'hearn, M. F. et al (2007).
57 // "Report of the IAU/IAG Working Group on cartographic coordinates and
58 // rotational elements: 2006". Celestial Mechanics and Dynamical Astronomy 98
59 // (3): 155–180. Bibcode 2007CeMDA..98..155S. doi:10.1007/s10569-007-9072-y
60 
61 
62 
63 /*===========================================================================
64  === The functions (in alphabetical order)
65  ===========================================================================*/
66 
67 /* Workspace method: Doxygen documentation will be auto-generated */
68 void g0Earth(
69  Numeric& g0,
70  const Numeric& lat,
71  const Verbosity& )
72 {
73  // "Small g" at altitude=0, g0:
74  // Expression for g0 taken from Wikipedia page "Gravity of Earth", that
75  // is stated to be: International Gravity Formula 1967, the 1967 Geodetic
76  // Reference System Formula, Helmert's equation or Clairault's formula.
77 
78  const Numeric x = DEG2RAD * fabs( lat );
79 
80  g0 = 9.780327 * ( 1 + 5.3024e-3 * pow( sin(x), 2.0 ) +
81  5.8e-6 * pow( sin(2*x), 2.0 ) );
82 }
83 
84 /* Workspace method: Doxygen documentation will be auto-generated */
85 void g0Jupiter(
86  Numeric& g0,
87  const Verbosity& )
88 {
89  // value from MPS, ESA-planetary
90  g0 = 23.12;
91  // value (1bar level) from http://nssdc.gsfc.nasa.gov/planetary/factsheet/jupiterfact.html
92  // g0 = 24.79;
93 }
94 
95 /* Workspace method: Doxygen documentation will be auto-generated */
96 void g0Mars(
97  Numeric& g0,
98  const Verbosity& )
99 {
100  // value from MPS, ESA-planetary
101  g0 = 3.690;
102 }
103 
104 /* Workspace method: Doxygen documentation will be auto-generated */
105 void g0Venus(
106  Numeric& g0,
107  const Verbosity& )
108 {
109  // value via MPS, ESA-planetary from Ahrens, 1995
110  g0 = 8.870;
111 }
112 
113 
114 
115 /* Workspace method: Doxygen documentation will be auto-generated */
117  Vector& refellipsoid,
118  const String& model,
119  const Verbosity& )
120 {
121  refellipsoid.resize(2);
122 
123  if( model == "Sphere" )
124  {
125  refellipsoid[0] = EARTH_RADIUS;
126  refellipsoid[1] = 0;
127  }
128 
129  else if( model == "WGS84" )
130  { // Values taken from atmlab's ellipsoidmodels.m
131  refellipsoid[0] = 6378137;
132  refellipsoid[1] = 0.081819190842621;
133  }
134 
135  else
136  throw runtime_error( "Unknown selection for input argument *model*." );
137 }
138 
139 
140 
141 /* Workspace method: Doxygen documentation will be auto-generated */
143  Vector& refellipsoid,
144  const String& model,
145  const Verbosity& )
146 {
147  refellipsoid.resize(2);
148 
149  if( model == "Sphere" )
150  {
151  refellipsoid[0] = 69911e3; // From Ref. 1 (see above)
152  refellipsoid[1] = 0;
153  }
154 
155  else if( model == "Ellipsoid" )
156  {
157  refellipsoid[0] = 71492e3; // From Ref. 1
158  refellipsoid[1] = 0.3543; // Based on Ref. 1
159  }
160 
161  else
162  throw runtime_error( "Unknown selection for input argument *model*." );
163 }
164 
165 
166 
167 /* Workspace method: Doxygen documentation will be auto-generated */
169  Vector& refellipsoid,
170  const String& model,
171  const Verbosity& )
172 {
173  refellipsoid.resize(2);
174 
175  if( model == "Sphere" )
176  {
177  refellipsoid[0] = 3389.5e3; // From Ref. 1 (see above)
178  refellipsoid[1] = 0;
179  }
180 
181  else if( model == "Ellipsoid" )
182  {
183  refellipsoid[0] = 3396.19e3; // From Ref. 1
184  refellipsoid[1] = 0.1083; // Based on Ref. 1
185  }
186 
187  else
188  throw runtime_error( "Unknown selection for input argument *model*." );
189 }
190 
191 
192 
193 /* Workspace method: Doxygen documentation will be auto-generated */
195  Vector& refellipsoid,
196  const String& model,
197  const Verbosity& )
198 {
199  refellipsoid.resize(2);
200 
201  if( model == "Sphere" )
202  {
203  refellipsoid[0] = 1737.4e3; // From Ref. 1 (see above)
204  refellipsoid[1] = 0;
205  }
206 
207  else if( model == "Ellipsoid" )
208  { // Values taken from Wikipedia, with reference to:
209  // Williams, Dr. David R. (2 February 2006). "Moon Fact Sheet".
210  // NASA (National Space Science Data Center). Retrieved 31 December 2008.
211  refellipsoid[0] = 1738.14e3;
212  refellipsoid[1] = 0.0500;
213  }
214 
215  else
216  throw runtime_error( "Unknown selection for input argument *model*." );
217 }
218 
219 
220 
221 /* Workspace method: Doxygen documentation will be auto-generated */
223  Vector& refellipsoid,
224  const String& model,
225  const Verbosity& )
226 {
227  refellipsoid.resize(2);
228 
229  if( model == "Sphere" )
230  {
231  refellipsoid[0] = 6051.8e3; // From Ref. 1 (see above)
232  refellipsoid[1] = 0;
233  }
234 
235  else
236  throw runtime_error( "Unknown selection for input argument *model*." );
237 }
void refellipsoidEarth(Vector &refellipsoid, const String &model, const Verbosity &)
WORKSPACE METHOD: refellipsoidEarth.
Definition: m_planets.cc:116
void g0Mars(Numeric &g0, const Verbosity &)
WORKSPACE METHOD: g0Mars.
Definition: m_planets.cc:96
Declarations having to do with the four output streams.
const Numeric DEG2RAD
The Vector class.
Definition: matpackI.h:556
void g0Venus(Numeric &g0, const Verbosity &)
WORKSPACE METHOD: g0Venus.
Definition: m_planets.cc:105
void refellipsoidVenus(Vector &refellipsoid, const String &model, const Verbosity &)
WORKSPACE METHOD: refellipsoidVenus.
Definition: m_planets.cc:222
The implementation for String, the ARTS string class.
Definition: mystring.h:63
The global header file for ARTS.
void g0Earth(Numeric &g0, const Numeric &lat, const Verbosity &)
WORKSPACE METHOD: g0Earth.
Definition: m_planets.cc:68
NUMERIC Numeric
The type to use for all floating point numbers.
Definition: matpack.h:29
void g0Jupiter(Numeric &g0, const Verbosity &)
WORKSPACE METHOD: g0Jupiter.
Definition: m_planets.cc:85
void resize(Index n)
Assignment operator from VectorView.
Definition: matpackI.cc:798
const Numeric EARTH_RADIUS
void refellipsoidMoon(Vector &refellipsoid, const String &model, const Verbosity &)
WORKSPACE METHOD: refellipsoidMoon.
Definition: m_planets.cc:194
void refellipsoidMars(Vector &refellipsoid, const String &model, const Verbosity &)
WORKSPACE METHOD: refellipsoidMars.
Definition: m_planets.cc:168
void refellipsoidJupiter(Vector &refellipsoid, const String &model, const Verbosity &)
WORKSPACE METHOD: refellipsoidJupiter.
Definition: m_planets.cc:142