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