ARTS  2.4.0(git:4fb77825)
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  === File description
21  ===========================================================================*/
22 
34 /*===========================================================================
35  === External declarations
36  ===========================================================================*/
37 
38 #include <cmath>
39 #include <stdexcept>
40 #include "arts.h"
41 #include "check_input.h"
42 #include "matpackI.h"
43 #include "messages.h"
44 
45 extern const Numeric EARTH_RADIUS;
46 extern const Numeric DEG2RAD;
47 
48 // Ref. 1:
49 // Seidelmann, P. Kenneth; Archinal, B. A.; A'hearn, M. F. et al (2007).
50 // "Report of the IAU/IAG Working Group on cartographic coordinates and
51 // rotational elements: 2006". Celestial Mechanics and Dynamical Astronomy 98
52 // (3): 155–180. Bibcode 2007CeMDA..98..155S. doi:10.1007/s10569-007-9072-y
53 
54 /*===========================================================================
55  === The functions (in alphabetical order)
56  ===========================================================================*/
57 
58 /* Workspace method: Doxygen documentation will be auto-generated */
59 void g0Earth(Numeric& g0, const Numeric& lat, const Verbosity&) {
60  // "Small g" at altitude=0, g0:
61  // Expression for g0 taken from Wikipedia page "Gravity of Earth", that
62  // is stated to be: International Gravity Formula 1967, the 1967 Geodetic
63  // Reference System Formula, Helmert's equation or Clairault's formula.
64 
65  const Numeric x = DEG2RAD * fabs(lat);
66 
67  g0 = 9.780327 *
68  (1 + 5.3024e-3 * pow(sin(x), 2.0) + 5.8e-6 * pow(sin(2 * x), 2.0));
69 }
70 
71 /* Workspace method: Doxygen documentation will be auto-generated */
72 void g0Jupiter(Numeric& g0, const Verbosity&) {
73  // value from MPS, ESA-planetary
74  g0 = 23.12;
75  // value (1bar level) from http://nssdc.gsfc.nasa.gov/planetary/factsheet/jupiterfact.html
76  // g0 = 24.79;
77 }
78 
79 /* Workspace method: Doxygen documentation will be auto-generated */
80 void g0Mars(Numeric& g0, const Verbosity&) {
81  // value from MPS, ESA-planetary
82  g0 = 3.690;
83 }
84 
85 /* Workspace method: Doxygen documentation will be auto-generated */
86 void g0Venus(Numeric& g0, const Verbosity&) {
87  // value via MPS, ESA-planetary from Ahrens, 1995
88  g0 = 8.870;
89 }
90 
91 /* Workspace method: Doxygen documentation will be auto-generated */
92 void g0Io(Numeric& g0, const Verbosity&) {
93  // value via Wikipedia
94  g0 = 1.796;
95 }
96 
97 /* Workspace method: Doxygen documentation will be auto-generated */
99  const String& model,
100  const Verbosity&) {
101  refellipsoid.resize(2);
102 
103  if (model == "Sphere") {
105  refellipsoid[1] = 0;
106  }
107 
108  else if (model == "WGS84") { // Values taken from atmlab's ellipsoidmodels.m
109  refellipsoid[0] = 6378137;
110  refellipsoid[1] = 0.081819190842621;
111  }
112 
113  else
114  throw runtime_error("Unknown selection for input argument *model*.");
115 }
116 
117 /* Workspace method: Doxygen documentation will be auto-generated */
119  const String& model,
120  const Verbosity&) {
121  refellipsoid.resize(2);
122 
123  if (model == "Sphere") {
124  refellipsoid[0] = 69911e3; // From Ref. 1 (see above)
125  refellipsoid[1] = 0;
126  }
127 
128  else if (model == "Ellipsoid") {
129  refellipsoid[0] = 71492e3; // From Ref. 1
130  refellipsoid[1] = 0.3543; // Based on Ref. 1
131  }
132 
133  else
134  throw runtime_error("Unknown selection for input argument *model*.");
135 }
136 
137 /* Workspace method: Doxygen documentation will be auto-generated */
139  const String& model,
140  const Verbosity&) {
141  refellipsoid.resize(2);
142 
143  if (model == "Sphere") {
144  refellipsoid[0] = 3389.5e3; // From Ref. 1 (see above)
145  refellipsoid[1] = 0;
146  }
147 
148  else if (model == "Ellipsoid") {
149  refellipsoid[0] = 3396.19e3; // From Ref. 1
150  refellipsoid[1] = 0.1083; // Based on Ref. 1
151  }
152 
153  else
154  throw runtime_error("Unknown selection for input argument *model*.");
155 }
156 
157 /* Workspace method: Doxygen documentation will be auto-generated */
159  const String& model,
160  const Verbosity&) {
161  refellipsoid.resize(2);
162 
163  if (model == "Sphere") {
164  refellipsoid[0] = 1737.4e3; // From Ref. 1 (see above)
165  refellipsoid[1] = 0;
166  }
167 
168  else if (model ==
169  "Ellipsoid") { // Values taken from Wikipedia, with reference to:
170  // Williams, Dr. David R. (2 February 2006). "Moon Fact Sheet".
171  // NASA (National Space Science Data Center). Retrieved 31 December 2008.
172  refellipsoid[0] = 1738.14e3;
173  refellipsoid[1] = 0.0500;
174  }
175 
176  else
177  throw runtime_error("Unknown selection for input argument *model*.");
178 }
179 
180 /* Workspace method: Doxygen documentation will be auto-generated */
182  const String& model,
183  const Verbosity&) {
184  refellipsoid.resize(2);
185 
186  if (model == "Sphere") {
187  refellipsoid[0] =
188  1821.6e3; // From Wikipedia (and http://ssd.jpl.nasa.gov/?sat_phys_par)
189  refellipsoid[1] = 0;
190  }
191 
192  else
193  throw std::runtime_error("Unknown selection for input argument *model*.");
194 }
195 
196 /* Workspace method: Doxygen documentation will be auto-generated */
198  const String& model,
199  const Verbosity&) {
200  refellipsoid.resize(2);
201 
202  if (model == "Sphere") {
203  refellipsoid[0] =
204  1560.8e3; // From Wikipedia (and http://ssd.jpl.nasa.gov/?sat_phys_par)
205  refellipsoid[1] = 0;
206  }
207 
208  else
209  throw std::runtime_error("Unknown selection for input argument *model*.");
210 }
211 
212 /* Workspace method: Doxygen documentation will be auto-generated */
214  const String& model,
215  const Verbosity&) {
216  refellipsoid.resize(2);
217 
218  if (model == "Sphere") {
219  refellipsoid[0] =
220  2631e3; // From Wikipedia (and http://ssd.jpl.nasa.gov/?sat_phys_par)
221  refellipsoid[1] = 0;
222  }
223 
224  else
225  throw std::runtime_error("Unknown selection for input argument *model*.");
226 }
227 
228 /* Workspace method: Doxygen documentation will be auto-generated */
230  const String& model,
231  const Verbosity&) {
232  refellipsoid.resize(2);
233 
234  if (model == "Sphere") {
235  refellipsoid[0] = 6051.8e3; // From Ref. 1 (see above)
236  refellipsoid[1] = 0;
237  }
238 
239  else
240  throw runtime_error("Unknown selection for input argument *model*.");
241 }
DEG2RAD
const Numeric DEG2RAD
refellipsoidMars
void refellipsoidMars(Vector &refellipsoid, const String &model, const Verbosity &)
WORKSPACE METHOD: refellipsoidMars.
Definition: m_planets.cc:138
g0Mars
void g0Mars(Numeric &g0, const Verbosity &)
WORKSPACE METHOD: g0Mars.
Definition: m_planets.cc:80
ARTS::Var::lat
Numeric lat(Workspace &ws) noexcept
Definition: autoarts.h:3933
ARTS::Var::g0
Numeric g0(Workspace &ws) noexcept
Definition: autoarts.h:3516
refellipsoidGanymede
void refellipsoidGanymede(Vector &refellipsoid, const String &model, const Verbosity &)
WORKSPACE METHOD: refellipsoidGanymede.
Definition: m_planets.cc:213
g0Io
void g0Io(Numeric &g0, const Verbosity &)
WORKSPACE METHOD: g0Io.
Definition: m_planets.cc:92
refellipsoidVenus
void refellipsoidVenus(Vector &refellipsoid, const String &model, const Verbosity &)
WORKSPACE METHOD: refellipsoidVenus.
Definition: m_planets.cc:229
matpackI.h
Implementation of Matrix, Vector, and such stuff.
pow
Numeric pow(const Rational base, Numeric exp)
Power of.
Definition: rational.h:628
refellipsoidJupiter
void refellipsoidJupiter(Vector &refellipsoid, const String &model, const Verbosity &)
WORKSPACE METHOD: refellipsoidJupiter.
Definition: m_planets.cc:118
messages.h
Declarations having to do with the four output streams.
my_basic_string< char >
refellipsoidIo
void refellipsoidIo(Vector &refellipsoid, const String &model, const Verbosity &)
WORKSPACE METHOD: refellipsoidIo.
Definition: m_planets.cc:181
refellipsoidEarth
void refellipsoidEarth(Vector &refellipsoid, const String &model, const Verbosity &)
WORKSPACE METHOD: refellipsoidEarth.
Definition: m_planets.cc:98
refellipsoidEuropa
void refellipsoidEuropa(Vector &refellipsoid, const String &model, const Verbosity &)
WORKSPACE METHOD: refellipsoidEuropa.
Definition: m_planets.cc:197
Numeric
NUMERIC Numeric
The type to use for all floating point numbers.
Definition: matpack.h:33
Verbosity
Definition: messages.h:49
ARTS::Var::refellipsoid
Vector refellipsoid(Workspace &ws) noexcept
Definition: autoarts.h:5519
g0Jupiter
void g0Jupiter(Numeric &g0, const Verbosity &)
WORKSPACE METHOD: g0Jupiter.
Definition: m_planets.cc:72
refellipsoidMoon
void refellipsoidMoon(Vector &refellipsoid, const String &model, const Verbosity &)
WORKSPACE METHOD: refellipsoidMoon.
Definition: m_planets.cc:158
g0Venus
void g0Venus(Numeric &g0, const Verbosity &)
WORKSPACE METHOD: g0Venus.
Definition: m_planets.cc:86
ARTS::Var::x
Vector x(Workspace &ws) noexcept
Definition: autoarts.h:7346
g0Earth
void g0Earth(Numeric &g0, const Numeric &lat, const Verbosity &)
WORKSPACE METHOD: g0Earth.
Definition: m_planets.cc:59
check_input.h
EARTH_RADIUS
const Numeric EARTH_RADIUS
Vector
The Vector class.
Definition: matpackI.h:860
arts.h
The global header file for ARTS.