ARTS 2.5.11 (git: 6827797f)
m_planets.cc
Go to the documentation of this file.
1/*===========================================================================
2 === File description
3 ===========================================================================*/
4
16/*===========================================================================
17 === External declarations
18 ===========================================================================*/
19
20#include <cmath>
21#include <stdexcept>
22#include "agenda_set.h"
23#include "arts.h"
24#include "arts_constants.h"
25#include "arts_conversions.h"
26#include "auto_md.h"
27#include "check_input.h"
28#include "matpack_data.h"
29#include "messages.h"
30
31inline constexpr Numeric EARTH_RADIUS=Constant::earth_radius;
32inline constexpr Numeric DEG2RAD=Conversion::deg2rad(1);
33
34// Ref. 1:
35// Seidelmann, P. Kenneth; Archinal, B. A.; A'hearn, M. F. et al (2007).
36// "Report of the IAU/IAG Working Group on cartographic coordinates and
37// rotational elements: 2006". Celestial Mechanics and Dynamical Astronomy 98
38// (3): 155–180. Bibcode 2007CeMDA..98..155S. doi:10.1007/s10569-007-9072-y
39
40/*===========================================================================
41 === The functions (in alphabetical order)
42 ===========================================================================*/
43
44/* Workspace method: Doxygen documentation will be auto-generated */
45void g0Earth(Numeric& g0, const Numeric& lat, const Verbosity&) {
46 // "Small g" at altitude=0, g0:
47 // Expression for g0 taken from Wikipedia page "Gravity of Earth", that
48 // is stated to be: International Gravity Formula 1967, the 1967 Geodetic
49 // Reference System Formula, Helmert's equation or Clairault's formula.
50
51 const Numeric x = DEG2RAD * fabs(lat);
52
53 g0 = 9.780327 *
54 (1 + 5.3024e-3 * pow(sin(x), 2.0) + 5.8e-6 * pow(sin(2 * x), 2.0));
55
56 // Move to apparent gravity, i.e. include effect of the centrifugal force. See:
57 // A first course in Atmospheric Thermodynamics by G. Petty (page 89)
58 // As well as https://glossary.ametsoc.org/wiki/Apparent_gravity
59 // 0.033895 = (7.29e-5)^2 * 6378e3
60 g0 -= 0.033895 * pow(cos(x), 2.0);
61}
62
63/* Workspace method: Doxygen documentation will be auto-generated */
64void g0Jupiter(Numeric& g0, const Verbosity&) {
65 // value from MPS, ESA-planetary
66 g0 = 23.12;
67 // value (1bar level) from http://nssdc.gsfc.nasa.gov/planetary/factsheet/jupiterfact.html
68 // g0 = 24.79;
69}
70
71/* Workspace method: Doxygen documentation will be auto-generated */
72void g0Mars(Numeric& g0, const Verbosity&) {
73 // value from MPS, ESA-planetary
74 g0 = 3.690;
75}
76
77/* Workspace method: Doxygen documentation will be auto-generated */
78void g0Venus(Numeric& g0, const Verbosity&) {
79 // value via MPS, ESA-planetary from Ahrens, 1995
80 g0 = 8.870;
81}
82
83/* Workspace method: Doxygen documentation will be auto-generated */
84void g0Io(Numeric& g0, const Verbosity&) {
85 // value via Wikipedia
86 g0 = 1.796;
87}
88
89/* Workspace method: Doxygen documentation will be auto-generated */
90void refellipsoidEarth(Vector& refellipsoid,
91 const String& model,
92 const Verbosity&) {
93 refellipsoid.resize(2);
94
95 if (model == "Sphere") {
96 refellipsoid[0] = EARTH_RADIUS;
97 refellipsoid[1] = 0;
98 }
99
100 else if (model == "WGS84") { // Values taken from atmlab's ellipsoidmodels.m
101 refellipsoid[0] = 6378137;
102 refellipsoid[1] = 0.081819190842621;
103 }
104
105 else
106 throw runtime_error("Unknown selection for input argument *model*.");
107}
108
109/* Workspace method: Doxygen documentation will be auto-generated */
110void refellipsoidJupiter(Vector& refellipsoid,
111 const String& model,
112 const Verbosity&) {
113 refellipsoid.resize(2);
114
115 if (model == "Sphere") {
116 refellipsoid[0] = 69911e3; // From Ref. 1 (see above)
117 refellipsoid[1] = 0;
118 }
119
120 else if (model == "Ellipsoid") {
121 refellipsoid[0] = 71492e3; // From Ref. 1
122 refellipsoid[1] = 0.3543; // Based on Ref. 1
123 }
124
125 else
126 throw runtime_error("Unknown selection for input argument *model*.");
127}
128
129/* Workspace method: Doxygen documentation will be auto-generated */
130void refellipsoidMars(Vector& refellipsoid,
131 const String& model,
132 const Verbosity&) {
133 refellipsoid.resize(2);
134
135 if (model == "Sphere") {
136 refellipsoid[0] = 3389.5e3; // From Ref. 1 (see above)
137 refellipsoid[1] = 0;
138 }
139
140 else if (model == "Ellipsoid") {
141 refellipsoid[0] = 3396.19e3; // From Ref. 1
142 refellipsoid[1] = 0.1083; // Based on Ref. 1
143 }
144
145 else
146 throw runtime_error("Unknown selection for input argument *model*.");
147}
148
149/* Workspace method: Doxygen documentation will be auto-generated */
150void refellipsoidMoon(Vector& refellipsoid,
151 const String& model,
152 const Verbosity&) {
153 refellipsoid.resize(2);
154
155 if (model == "Sphere") {
156 refellipsoid[0] = 1737.4e3; // From Ref. 1 (see above)
157 refellipsoid[1] = 0;
158 }
159
160 else if (model ==
161 "Ellipsoid") { // Values taken from Wikipedia, with reference to:
162 // Williams, Dr. David R. (2 February 2006). "Moon Fact Sheet".
163 // NASA (National Space Science Data Center). Retrieved 31 December 2008.
164 refellipsoid[0] = 1738.14e3;
165 refellipsoid[1] = 0.0500;
166 }
167
168 else
169 throw runtime_error("Unknown selection for input argument *model*.");
170}
171
172/* Workspace method: Doxygen documentation will be auto-generated */
173void refellipsoidIo(Vector& refellipsoid,
174 const String& model,
175 const Verbosity&) {
176 refellipsoid.resize(2);
177
178 if (model == "Sphere") {
179 refellipsoid[0] =
180 1821.6e3; // From Wikipedia (and http://ssd.jpl.nasa.gov/?sat_phys_par)
181 refellipsoid[1] = 0;
182 }
183
184 else
185 throw std::runtime_error("Unknown selection for input argument *model*.");
186}
187
188/* Workspace method: Doxygen documentation will be auto-generated */
189void refellipsoidEuropa(Vector& refellipsoid,
190 const String& model,
191 const Verbosity&) {
192 refellipsoid.resize(2);
193
194 if (model == "Sphere") {
195 refellipsoid[0] =
196 1560.8e3; // From Wikipedia (and http://ssd.jpl.nasa.gov/?sat_phys_par)
197 refellipsoid[1] = 0;
198 }
199
200 else
201 throw std::runtime_error("Unknown selection for input argument *model*.");
202}
203
204/* Workspace method: Doxygen documentation will be auto-generated */
205void refellipsoidGanymede(Vector& refellipsoid,
206 const String& model,
207 const Verbosity&) {
208 refellipsoid.resize(2);
209
210 if (model == "Sphere") {
211 refellipsoid[0] =
212 2631e3; // From Wikipedia (and http://ssd.jpl.nasa.gov/?sat_phys_par)
213 refellipsoid[1] = 0;
214 }
215
216 else
217 throw std::runtime_error("Unknown selection for input argument *model*.");
218}
219
220/* Workspace method: Doxygen documentation will be auto-generated */
221void refellipsoidVenus(Vector& refellipsoid,
222 const String& model,
223 const Verbosity&) {
224 refellipsoid.resize(2);
225
226 if (model == "Sphere") {
227 refellipsoid[0] = 6051.8e3; // From Ref. 1 (see above)
228 refellipsoid[1] = 0;
229 }
230
231 else
232 throw runtime_error("Unknown selection for input argument *model*.");
233}
234
236 Agenda& g0_agenda,
237 Vector& refellipsoid,
238 Numeric& molarmass_dry_air,
239 Numeric& planet_rotation_period,
240 const String& option,
241 const Verbosity& verbosity) {
242 refellipsoid = Vector{};
243 molarmass_dry_air = 0.0;
244 planet_rotation_period = 0.0;
245
246 using enum Options::planetDefaultOptions;
247 switch (Options::toplanetDefaultOptionsOrThrow(option)) {
248 case Earth:
249 refellipsoidEarth(refellipsoid, "Sphere", verbosity);
250 molarmass_dry_air = 28.966;
251 planet_rotation_period = 86164.1;
252 break;
253 case Io:
254 refellipsoidIo(refellipsoid, "Sphere", verbosity);
255 molarmass_dry_air = 63.110068828000003;
256 planet_rotation_period = 152853;
257 break;
258 case Jupiter:
259 refellipsoidJupiter(refellipsoid, "Sphere", verbosity);
260 molarmass_dry_air = 2.22;
261 planet_rotation_period = 35730;
262 break;
263 case Mars:
264 refellipsoidMars(refellipsoid, "Sphere", verbosity);
265 molarmass_dry_air = 43.34;
266 planet_rotation_period = 88643;
267 break;
268 case Venus:
269 refellipsoidVenus(refellipsoid, "Sphere", verbosity);
270 molarmass_dry_air = 43.45;
271 planet_rotation_period = -2.0997e7;
272 break;
273 case FINAL:
274 break;
275 }
276
277 g0_agenda = AgendaManip::get_g0_agenda(ws, option);
278}
The global header file for ARTS.
Constants of physical expressions as constexpr.
Common ARTS conversions.
The Agenda class.
Definition: agenda_class.h:52
Workspace class.
Definition: workspace_ng.h:36
void g0Jupiter(Numeric &g0, const Verbosity &)
WORKSPACE METHOD: g0Jupiter.
Definition: m_planets.cc:64
void g0Earth(Numeric &g0, const Numeric &lat, const Verbosity &)
WORKSPACE METHOD: g0Earth.
Definition: m_planets.cc:45
void refellipsoidMoon(Vector &refellipsoid, const String &model, const Verbosity &)
WORKSPACE METHOD: refellipsoidMoon.
Definition: m_planets.cc:150
void refellipsoidMars(Vector &refellipsoid, const String &model, const Verbosity &)
WORKSPACE METHOD: refellipsoidMars.
Definition: m_planets.cc:130
constexpr Numeric EARTH_RADIUS
Definition: m_planets.cc:31
constexpr Numeric DEG2RAD
Definition: m_planets.cc:32
void PlanetSet(Workspace &ws, Agenda &g0_agenda, Vector &refellipsoid, Numeric &molarmass_dry_air, Numeric &planet_rotation_period, const String &option, const Verbosity &verbosity)
WORKSPACE METHOD: PlanetSet.
Definition: m_planets.cc:235
void refellipsoidEuropa(Vector &refellipsoid, const String &model, const Verbosity &)
WORKSPACE METHOD: refellipsoidEuropa.
Definition: m_planets.cc:189
void refellipsoidVenus(Vector &refellipsoid, const String &model, const Verbosity &)
WORKSPACE METHOD: refellipsoidVenus.
Definition: m_planets.cc:221
void refellipsoidJupiter(Vector &refellipsoid, const String &model, const Verbosity &)
WORKSPACE METHOD: refellipsoidJupiter.
Definition: m_planets.cc:110
void refellipsoidEarth(Vector &refellipsoid, const String &model, const Verbosity &)
WORKSPACE METHOD: refellipsoidEarth.
Definition: m_planets.cc:90
void g0Io(Numeric &g0, const Verbosity &)
WORKSPACE METHOD: g0Io.
Definition: m_planets.cc:84
void g0Mars(Numeric &g0, const Verbosity &)
WORKSPACE METHOD: g0Mars.
Definition: m_planets.cc:72
void refellipsoidIo(Vector &refellipsoid, const String &model, const Verbosity &)
WORKSPACE METHOD: refellipsoidIo.
Definition: m_planets.cc:173
void g0Venus(Numeric &g0, const Verbosity &)
WORKSPACE METHOD: g0Venus.
Definition: m_planets.cc:78
void refellipsoidGanymede(Vector &refellipsoid, const String &model, const Verbosity &)
WORKSPACE METHOD: refellipsoidGanymede.
Definition: m_planets.cc:205
Declarations having to do with the four output streams.
Agenda get_g0_agenda(Workspace &ws, const String &option)
Definition: agenda_set.cc:522
constexpr Numeric earth_radius
Global constant, the radius of the Earth [m].
constexpr auto deg2rad(auto x) noexcept
Converts degrees to radians.